This one time, at band camp, VamVan <[EMAIL PROTECTED]> wrote:
> I was wondering how is it possible for me to query the table to retrieve all
> the records that are one week less than the time stamp?
SELECT DATE_SUB(date_time_column, INTERVAL 1 WEEK) FROM your_table;
http://www.phpro.org/tutoria
VamVan wrote:
Hello Gang,
I have a Mysql table which has timestamp for the date the record was
created.
I was wondering how is it possible for me to query the table to retrieve all
the records that are one week less than the time stamp?
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-fun
VamVan wrote:
> Hello Gang,
>
> I have a Mysql table which has timestamp for the date the record was
> created.
>
> I was wondering how is it possible for me to query the table to retrieve all
> the records that are one week less than the time stamp?
>
> Thanks,
> V
>
>
I'm assuming you meant g
On Monday 31 March 2008, Zoltán Németh wrote:
> VamVan írta:
> > Hello All,
> >
> > I have a date in 2008-03-29 12:15:00 format.
> >
> >- How can I reduce one day from it?
> >- How can I reduce one hour from it?
> >- How can I add 1 hour to today's date?
> >
> > Thanks
>
> just convert
Zoltán Németh wrote:
VamVan írta:
Hello All,
I have a date in 2008-03-29 12:15:00 format.
- How can I reduce one day from it?
- How can I reduce one hour from it?
- How can I add 1 hour to today's date?
Thanks
just convert it to a timestamp with strtotime()
then you can manipulat
VamVan írta:
Hello All,
I have a date in 2008-03-29 12:15:00 format.
- How can I reduce one day from it?
- How can I reduce one hour from it?
- How can I add 1 hour to today's date?
Thanks
just convert it to a timestamp with strtotime()
then you can manipulate it by adding/substra
On Tue, April 10, 2007 11:38 am, Satyam wrote:
> In PHP dates are stored as seconds from an arbitrary zero set at Jan
> 1st,
> 1970, so does MySql with date/time values though it shows them
> formatted but
nitpick:
I don't think MySQL uses Unix timestamp internally, as it's quite
capable of storin
On Tue, April 10, 2007 11:49 am, Satyam wrote:
> You are totally right, I am sorry. I would hate to miss my plane or
> train
> due to such mistake.
Can somebody with way more karma than me put in an RFC to just NUKE
daylight savings?
Pretty please?
Thanks!
Whatever alleged benefits there are,
You are totally right, I am sorry. I would hate to miss my plane or train
due to such mistake.
Satyam
- Original Message -
From: "Lester Caine" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, April 10, 2007 6:29 PM
Subject: Re: [PHP] Dates and different time zones
Satyam
- Original Message -
From: "Niklas Karlsson" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, April 10, 2007 5:32 PM
Subject: RE: [PHP] Dates and different time zones
Thanks for good answers.
Okay, so I should set the default time zone to central GMT time, and then
save GMT
Satyam wrote:
Of cause the major fault with this is that it can only display the
CURRENT time offset. You *ALSO* need the users Daylight Saving Zone as
well. This has been giving us great fun since the winter dates and
times need a different offset to the summer ones. Something that
simplisti
Niklas Karlsson wrote:
Okay, so I should set the default time zone to central GMT time, and then
save GMT offset for every user. This sounds realistic, because I don't think
that I need to correct the time for users that doesn't login.
So, if I now have the GMT offset for every user, how do I d
Thanks for good answers.
Okay, so I should set the default time zone to central GMT time, and then
save GMT offset for every user. This sounds realistic, because I don't think
that I need to correct the time for users that doesn't login.
So, if I now have the GMT offset for every user, how do I di
- Original Message -
From: "Lester Caine" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, April 10, 2007 4:37 PM
Subject: Re: [PHP] Dates and different time zones
Satyam wrote:
Store all of your dates as GMT. Perform all date based calculations
around GMT also, and then o
Satyam wrote:
Store all of your dates as GMT. Perform all date based calculations
around GMT also, and then offset the values for localised display only.
This way you only need to store the GMT offsets for each user, i.e.
GMT+1 or GMT-8 when it comes to displaying the dates to them. The
trick
- Original Message -
From: "Richard Davey" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, April 10, 2007 3:43 PM
Subject: Re: [PHP] Dates and different time zones
Niklas Karlsson wrote:
I am creating an international site that is going to get used in both
American a
Niklas Karlsson wrote:
I am creating an international site that is going to get used in both
American and Europe. And I wonder how to handle the different time zones,
because I want the date and time to be correct after the place your using
the application.
I now have the date_default_timezone_
[snip]
So a wonder who to handle different time zones? Have any of your
experience
of this?
[/snip]
The server lives in one time zone and therefore cannot handle multiples
unless there is some new widget available for this. There are a couple
of methods available;
1. Use JavaScript to capture 'lo
At 6:43 PM -0500 4/17/06, Richard Lynch wrote:
Call me crazy, but I think that:
$time = 0x; //largest INT possible
echo date('m/d/Y h:i:s a', $time);
would be very revealing.
H.
Is: 12/31/1969 06:59:59 pm
Yes, it is -- I remember what I was doing then. It was six months
after I
Call me crazy, but I think that:
$time = 0x; //largest INT possible
echo date('m/d/Y h:i:s a', $time);
would be very revealing.
On Thu, April 13, 2006 10:26 pm, Suhas wrote:
> This will definitely solve one way but still other is there,
> How to get that -ve number which starts at 1/1/19
> I have a project that deals with the date time stamps since 1900 (and
> past), any suggestions about a good class that handles Date Time
> Format before 1970. I really like date() function and want something
> similar.
If you're using a database at all, most of them will handle any sort of dates
This will definitely solve one way but still other is there,
How to get that -ve number which starts at 1/1/1900 at 00:00 AM = 0
I need to be able to convert back and forth as there are some
calculations to be done on date field,
But this is very interesting..
Thx
SP
On 4/13/06, Rasmus Lerdorf <
Suhas wrote:
Hello,
I have a project that deals with the date time stamps since 1900 (and
past), any suggestions about a good class that handles Date Time
Format before 1970. I really like date() function and want something
similar.
date() uses Unix timestamps which on most Unix platforms goes
Petar Nedyalkov escribió:
On Wednesday 27 April 2005 09:17, Mario de Frutos Dieguez wrote:
Hi!
I have a problem with dates. I have a function that sum a duration in
laboral days to an initial date. The problem come when the function
reaches the last sunday of October, the data remains in the las
On Wednesday 27 April 2005 09:17, Mario de Frutos Dieguez wrote:
> Hi!
>
> I have a problem with dates. I have a function that sum a duration in
> laboral days to an initial date. The problem come when the function
> reaches the last sunday of October, the data remains in the last sunday
> of Octob
Mark McCulligh wrote:
What function(s) would you use if you want to take someone's birth day and
format it on display.
I have always used strtotime, then strftime but it doesn't work if someone
was born in 1939. strtotime returns -1.
What function would you use to take the input string "1939/11/23
Also, an option is to have that SQL field set as date. With postgres, I
can insert 09-12-1967 and the sql server auto converts it to 1967-09-12
upon saving into date field. However, another way is..
Jay Blanchard wrote:
[snip]
Ok, Mayve I need to be a little clear, I under the link below as
[snip]
Ok, Mayve I need to be a little clear, I under the link below as showing
dates. What I need to know how can I take the input of 09-12-1967 and
have enter into a mysql data using php as 1967-09-12? Because
everything that is past from my form to mysql is not the way it was
enter. Would I
Ok, Mayve I need to be a little clear, I under the link below as showing
dates. What I need to know how can I take the input of 09-12-1967 and
have enter into a mysql data using php as 1967-09-12? Because
everything that is past from my form to mysql is not the way it was
enter. Would I need t
date("Y-m-d", strtotime($your_date))
Payne wrote:
> Hi ,
>
> This might be mysql question but how can I change a US format date
> (mm/dd/) to a MySQL Format (/mm/dd). Can I do this will php or
> will need let say javascript or perl to do this?
>
> Payne
>
> --
> PHP General Mailing List
[snip]
This might be mysql question but how can I change a US format date
(mm/dd/) to a MySQL Format (/mm/dd). Can I do this will php or
will need let say javascript or perl to do this?
[/snip]
date("y/m/d");
RTFM at http://www.php.net/date
--
PHP General Mailing List (http://www.php.
sage -
From: "John Wards" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 12, 2002 5:32 PM
Subject: Re: [PHP] dates greater than 2002-01-18 create error
> right am i missing something or is that not just an other Y2K "bug"
waiting
> to hap
EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 12, 2002 5:26 PM
Subject: RE: [PHP] dates greater than 2002-01-18 create error
> Dude, did you read the PHP Date manual page?
>
> I quote:
>
> Note: The valid range of a timestamp is typically from Fri, 13 Dec 1
Dude, did you read the PHP Date manual page?
I quote:
Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901
20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that
correspond to the minimum and maximum values for a 32-bit signed
integer). On windows this range
[snip]
[/snip]
I take out '+1' and the result is 1969-12-31
I put in the '+1' and the result is 1970-01-01
I change '2038-01-19' to '2002-01-19' and it works. Which is what the
subject of your message was, not [PHP] dates greater than 2038-01-18 create
error
HTH!
Jay
--
PHP General Maili
[snip]
Anytime I try to add a day to the date 2002-01-18, I get a
Warning: unexpected error in date()
error.
Can anyone shed some light on this.
[/snip]
If you'll shed some code on this, we'll shed some help :^]
Jay
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
inal Message -
> From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
> To: "Christopher J. Crane" <[EMAIL PROTECTED]>; "Andrey Hristov"
> <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, July 29, 2002 7:12 PM
> Subject:
;
To: "Christopher J. Crane" <[EMAIL PROTECTED]>; "Andrey Hristov"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 12:12 PM
Subject: Re: [PHP] Dates and Date()
> > Ok here is what I did.
> > $Hist_Time = gmstrftime('%m:%d:%Y
r way, I'm glad you helped him and he got it figured out...
---John Holmes...
- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 12:17 PM
Subject: Re: [PHP] Dates and Date()
> The guy just w
e people
always experiment some not.
Kind regards,
Andrey Hristov
- Original Message -
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Christopher J. Crane" <[EMAIL PROTECTED]>; "Andrey Hristov"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 7:08 PM
Subject: Re: [PHP] Dates and Date()
> very nice... thank you!
> - Original Message -
> From: "Andrey Hristov" <[EMAIL PROTECTED]>
> To: "Christopher J. Crane" <[EMAIL PR
> Ok here is what I did.
> $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
>
> Now I am wondering if there is a way to look for only the last day
business
> days and be returned in an array?
What have you tried? How much longer do we have to hold your hand?
Not to be too rude or any
very nice... thank you!
- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Christopher J. Crane" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 12:04 PM
Subject: Re: [PHP] Dates and Date()
> Use while
nter-1),2002);
}
}
HTH
Regards,
Andrey
- Original Message -
From: "Christopher J. Crane" <[EMAIL PROTECTED]>
To: "Andrey Hristov" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 7:00 PM
Subject: Re: [PHP] Dates and Date()
ECTED]>
To: "Christopher J. Crane" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 10:59 AM
Subject: Re: [PHP] Dates and Date()
>
>
> - Original Message -
> From: "Christopher J. Crane" <[EMAIL PROTECTED]>
> To:
- Original Message -
From: "Christopher J. Crane" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 5:51 PM
Subject: [PHP] Dates and Date()
> I believethisto be one way to find out yesterday's date:
> $tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y"));
On Mon, Jul 29, 2002 at 10:51:39AM -0400, Christopher J. Crane wrote:
> I believethisto be one way to find out yesterday's date:
> $tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y"));
>
> However, I would like to have a snippet of code to tell me how to get the
> date of today - 10 days
$ts = strtotime("-10 days");
On Mon, 29 Jul 2002, Christopher J. Crane wrote:
> I believethisto be one way to find out yesterday's date:
> $tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y"));
>
> However, I would like to have a snippet of code to tell me how to get the
> date of today
PHP way:
Use strtotime() to get a unix timestamp for each one. subtract smaller from
larger and divide by number of seconds in a day.
MySQL way:
I assume these dates come from a database. Use a query like this:
SELECT TO_DAYS(column_one) - TO_DAYS(column_two) AS Difference FROM table
WHERE ...
Something like this..
$start = "2002-10-9";
$end = "2002-11-16";
$arStart = explode("-", $start);
$arEnd = explode("-", $end);
$startTime = date("U", mktime(0,0,0,$arStart[1], $arStart[2], $arStart[0]));
$endTime = date("U", mktime(0,0,0,$arEnd[1], $arEnd[2], $arEnd[0]));
$dif = $endTime - $start
On Tue, 28 May 2002, Jeroen Timmers wrote:
> 2002-10-9 and 2002-11-16
>
> Is there a function to see how many day's between thore date's is?
(strtotime($date1) - strtotime($date2)) / 86400
miguel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/un
> I'm looking for a function which enables me to allow user
> only to enter those dates which are still to come. In my head
> I have three things... one for day, one for month and
> one for year. In order to prevent the user from submitting the
> form with the date which is in past, I need pr
Why don't you look into mYSQL documentation and rewrite your queries,
you might be able to end up with one only single query and 3 lines of PHP,
instead of the whole bunch as you're trying to do.
The reason I advise you that is that mySQL plays some really sweet games
with dates, while PHP treat
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("Alvin Tan") wrote:
> a little stuck here. trying to pull a bunch of unix timestamps out and show
> only those that show up today. problem is that when i hit the first match,
> the rest of the dates don't show. code follows:
>
> ===
My own solution to this is a bit more complex but it seems to work with both of the
databases I work with. MySQL and Postgress.
for example I would use 'select *,unix_timestamp(cr_date) as my_cr_date from table
where ref_index=2345;'
Then when I go to output it I can use the unix date command
> -Original Message-
> From: Matt Davis [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 07, 2001 7:35 AM
> To: Php Mailing List
> Subject: [PHP] dates from db
>
>
> I am calling on a number of fields from my db one of which is
> a date. When the date displays it is in the following
If it's stored as a unix timestamp you can format it any way you like.
[www.php.net/date]
If it's stored as a string in the -MM-DD hh:mm:ss format, you can use
substr(0,10) [www.php.net/substr] to get the first 10 characters and only
display those.
HTH
Jon
-Original Message-
From:
On Sun, Feb 18, 2001 at 06:54:02PM -0700, Julian Rockey wrote:
> Yes I had a look at mktime() and date() and tried to think of an easy
> way to do it but couldn't... you can convert both dates to a UNIX
> timestamp (millseconds after whatever date) then do a subtraction... and
> then what? Easy
Yes I had a look at mktime() and date() and tried to think of an easy
way to do it but couldn't... you can convert both dates to a UNIX
timestamp (millseconds after whatever date) then do a subtraction... and
then what? Easy to work out number of days from millseconds as a day's
length is fixe
On Sun, Feb 18, 2001 at 04:40:08PM -0700, Julian Rockeu wrote:
> Anyone know how to use the PHP date functions to work out the difference
> between two timestamps?
>
> For example..
>
> Figure out the number of seconds, minutes, hours, days, months and years
> between
>
> 5th October 2001 14:
60 matches
Mail list logo