Re: [PHP] DateTime wierdness

2012-03-29 Thread tamouse mailing lists
2012/3/29 Martín Marqués : > El día 29 de marzo de 2012 14:14, David OBrien escribió: >> actually this would work well ... compare what they send with the output of >> the formatdate >> >> function checkDateTime($data) { >>     if (date('Y-m-d H:i:s', strtotime($data)) == $data) { >>         retur

Re: [PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
El día 29 de marzo de 2012 14:14, David OBrien escribió: > actually this would work well ... compare what they send with the output of > the formatdate > > function checkDateTime($data) { >     if (date('Y-m-d H:i:s', strtotime($data)) == $data) { >         return true; >     } else { >         re

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
actually this would work well ... compare what they send with the output of the formatdate function checkDateTime($data) { if (date('Y-m-d H:i:s', strtotime($data)) == $data) { return true; } else { return false; } } 2012/3/29 David OBrien > http://www.php.net/manual

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
http://www.php.net/manual/en/function.checkdate.php 2012/3/29 Martín Marqués > OK. So what would be a good way to validate a date? > > El día 29 de marzo de 2012 14:04, David OBrien > escribió: > > > > echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012)); > > > > this outputs "02-14-13" also so my

Re: [PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
OK. So what would be a good way to validate a date? El día 29 de marzo de 2012 14:04, David OBrien escribió: > > echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012)); > > this outputs "02-14-13" also so my guess is that it is being interpreted the > same as  "12/14/2012 +2 months" > > echo date("m-d-

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012)); this outputs "02-14-13" also so my guess is that it is being interpreted the same as "12/14/2012 +2 months" echo date("m-d-y",mktime(0, 0, 0, 1, 45, 2012)); outputs "02-14-12" which is 1/1/12 +45 days 2012/3/29 Martín Marqués > Can someone

[PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
Can someone explain to me this weierdness I see when using the DateTime module of PHP. Here I send 14/14/2012 which is not a valid date, and I would expect to recieve false, but instead, it looks like it wrapping to the next year, as if 14 monthas are 1 year and 2 months. That isn't what's suppose

Re: [PHP] DateTime using DateTimeZone Timestamp problem

2011-04-05 Thread Richard Quadling
On 4 April 2011 16:35, Ian wrote: > Hi, > > I have a problem using the php built in classes DateTime and DateTimeZone. > > The idea behind the following code is to return the timestamp for the > current time in Singapore (or other places).  What it actually returns > is the timestamp for the local

Re: [PHP] DateTime using DateTimeZone Timestamp problem

2011-04-05 Thread Simon J Welsh
On 5/04/2011, at 3:35 AM, Ian wrote: > Hi, > > I have a problem using the php built in classes DateTime and DateTimeZone. > > The idea behind the following code is to return the timestamp for the > current time in Singapore (or other places). What it actually returns > is the timestamp for the

Re: [PHP] DateTime using DateTimeZone Timestamp problem

2011-04-04 Thread Ashley Sheridan
On Mon, 2011-04-04 at 16:35 +0100, Ian wrote: > Hi, > > I have a problem using the php built in classes DateTime and DateTimeZone. > > The idea behind the following code is to return the timestamp for the > current time in Singapore (or other places). What it actually returns > is the timestamp

[PHP] DateTime using DateTimeZone Timestamp problem

2011-04-04 Thread Ian
Hi, I have a problem using the php built in classes DateTime and DateTimeZone. The idea behind the following code is to return the timestamp for the current time in Singapore (or other places). What it actually returns is the timestamp for the local system. Other formatted dates appear to return

[PHP] DateTime/DateInterval/DatePeriod Class PHP source for older than PHP 5.3.0

2009-09-28 Thread jeff brown
So I'm jealous, the functionality in the DateTime class, DateInterval class and DatePeriod class are exactly what I need in my current application, but my Host is on PHP 5.2.10, which has a partial DateTime class, but not the others. I'd like to add a: --

Re: [PHP] DateTime... What else ?

2008-04-17 Thread David BERCOT
Le Thu, 17 Apr 2008 10:19:10 +0100, Stut <[EMAIL PROTECTED]> a écrit : > On 17 Apr 2008, at 10:05, David BERCOT wrote: > > I've got a problem with DateTime. I have a short code which gives an > > error : > > > > > > $date = new DateTime(date("d/m/Y")); > > $date->modify("-1 month"); > > $mois_en_c

Re: [PHP] DateTime... What else ?

2008-04-17 Thread David BERCOT
Hi again, Le Thu, 17 Apr 2008 21:10:44 +1200, Simon Welsh <[EMAIL PROTECTED]> a écrit : > On 17/04/2008, at 9:05, David BERCOT wrote: > > Hi, > > > > I've got a problem with DateTime. I have a short code which gives an > > error : > > > > > > $date = new DateTime(date("d/m/Y")); > > $date->modify

Re: [PHP] DateTime... What else ?

2008-04-17 Thread Stut
On 17 Apr 2008, at 10:05, David BERCOT wrote: I've got a problem with DateTime. I have a short code which gives an error : $date = new DateTime(date("d/m/Y")); $date->modify("-1 month"); $mois_en_cours1 = $date->format("Y-m"); $date->modify("-1 month"); $mois_en_cours2 = $date->format("Y-m"); $

Re: [PHP] DateTime... What else ?

2008-04-17 Thread Simon Welsh
On 17/04/2008, at 9:05, David BERCOT wrote: Hi, I've got a problem with DateTime. I have a short code which gives an error : $date = new DateTime(date("d/m/Y")); $date->modify("-1 month"); $mois_en_cours1 = $date->format("Y-m"); $date->modify("-1 month"); $mois_en_cours2 = $date->format("Y-m"

[PHP] DateTime... What else ?

2008-04-17 Thread David BERCOT
Hi, I've got a problem with DateTime. I have a short code which gives an error : $date = new DateTime(date("d/m/Y")); $date->modify("-1 month"); $mois_en_cours1 = $date->format("Y-m"); $date->modify("-1 month"); $mois_en_cours2 = $date->format("Y-m"); $date->modify("-1 month"); $mois_en_cours3 =

Re: [PHP] DATETIME or UNIX TIMESTAMPS?

2006-10-26 Thread Larry Garfield
On Thursday 26 October 2006 15:36, Marcelo de Moraes Serpa wrote: > Hello list, > > I've always used Unix Timestamps until now, but lately I've reading about > MySQL's datetime datatype and its benefits (dates before 1970, after 2030, > SQL functions to deal with them, etc). However, I don't see mu

[PHP] DATETIME or UNIX TIMESTAMPS?

2006-10-26 Thread Marcelo de Moraes Serpa
Hello list, I've always used Unix Timestamps until now, but lately I've reading about MySQL's datetime datatype and its benefits (dates before 1970, after 2030, SQL functions to deal with them, etc). However, I don't see much support for them in the PHP API. I'm also a Flash programmer and the Fl

Re: [PHP] datetime formatting problem

2004-05-28 Thread Stephen Lake
like a charm and i'm off to read up some more on strtotime. best, m. -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: Friday, May 28, 2004 2:07 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] datetime formatting problem "Daniel Clark" <[EMAIL PROTEC

RE: [PHP] datetime formatting problem

2004-05-28 Thread Matt Newell
appreciate the headsup, but all times will be from when record is inserted which will not be possible before today. thanks, m. -Original Message- From: Jordan S. Jones [mailto:[EMAIL PROTECTED] Sent: Friday, May 28, 2004 2:20 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] datetime

RE: [PHP] datetime formatting problem

2004-05-28 Thread Matt Newell
thanks a bunch torsten. it worked like a charm and i'm off to read up some more on strtotime. best, m. -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: Friday, May 28, 2004 2:07 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] datetime formatting problem "Da

Re: [PHP] datetime formatting problem

2004-05-28 Thread Jordan S. Jones
[snip /] Hi Matt, try this: function formatDate($val) { $timestamp = strtotime($val); return date('M d, Y g:i A', $timestamp); } strtotime possibly will not work if your date is < 01/01/1970. [snip /] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

Re: [PHP] datetime formatting problem

2004-05-28 Thread Torsten Roehr
"Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Isn't "date" a reserved word? date and dateTime are not reserved in MySQL and can be used as column names. > > > hi all - > > > > this is probably straight forward, but i'm learning and would appreciate > > any insight.

Re: [PHP] datetime formatting problem

2004-05-28 Thread Daniel Clark
Isn't "date" a reserved word? > hi all - > > this is probably straight forward, but i'm learning and would appreciate > any insight. > > i'm using the datetime type in mysql and have been able to successsfully > pull the data records's date, but it's failing out and giving me the > current time [a

[PHP] datetime formatting problem

2004-05-28 Thread Matt Newell
hi all - this is probably straight forward, but i'm learning and would appreciate any insight. i'm using the datetime type in mysql and have been able to successsfully pull the data records's date, but it's failing out and giving me the current time [as in what it says on my system's clock] bas

Re: [PHP] datetime control

2004-02-09 Thread Tom Rogers
Hi, Monday, February 9, 2004, 10:42:24 PM, you wrote: AZ> is there a date picker object or control that i can use on an HTML page, AZ> instead of making lots of dropdown lists for the various date fields? AZ> thanx in advance AZ> angelo AZ> ---

[PHP] datetime control

2004-02-09 Thread Angelo Zanetti
is there a date picker object or control that i can use on an HTML page, instead of making lots of dropdown lists for the various date fields? thanx in advance angelo Disclaimer This e-mail transmission contains confidential in

Re: [PHP] datetime

2003-08-22 Thread Marek Kilimajer
Best and fastest way is to let mysql format the date, look into mysql manual for DATE_FORMAT() function. Dale Hersh wrote: I am using a mssql database and I have a question regarding the datetime type. When I write a date to the database it store the date in the following format: 6/8/03 But when

RE: [PHP] datetime

2003-08-21 Thread Cody Phanekham
e to do is replace "Jun 8 2003 12:00AM" with data retrieved from the DB > -Original Message- > From: Dale Hersh [mailto:[EMAIL PROTECTED] > Sent: Friday, 22 August 2003 12:13 > To: [EMAIL PROTECTED] > Subject: [PHP] datetime > > > I am using a mssql data

Re: [PHP] datetime

2003-08-21 Thread Larry_Li
Subject: [PHP] datetime I am using a mssql database and I have a question regarding the datetime type. When I write a date to the database it store the date in the following format: 6/8/03 But when I extract the date from the database it returns the value in the following format: Jun 8

[PHP] datetime

2003-08-21 Thread Dale Hersh
I am using a mssql database and I have a question regarding the datetime type. When I write a date to the database it store the date in the following format: 6/8/03 But when I extract the date from the database it returns the value in the following format: Jun 8 2003 12:00AM Is there a nice funct

Re: [PHP] datetime

2003-04-03 Thread Sara Golemon
'g' is 12-hour format, 'H' is 24 hour (with leading 0) date("Y-m-d H:i:s",$date); "Sebastian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > $date = date("Y-m-d g:i:s", $date); > echo $date; > > cheers, > - Sebastian > > -Original Message- > From: Tim Haskins [mailto:[EMA

Re: [PHP] datetime

2003-04-03 Thread Sebastian
$date = date("Y-m-d g:i:s", $date); echo $date; cheers, - Sebastian -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] > How does one retrieve the date and time off a server in the following > format? > > 2003-04-03 11:11:38 -- PHP General Mailing List (http://www.php.

RE: [PHP] datetime

2003-04-03 Thread Matt Schroebel
> -Original Message- > From: Tim Haskins [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 03, 2003 2:45 PM > To: [EMAIL PROTECTED] > Subject: [PHP] datetime > > > How does one retrieve the date and time off a server in the following > format? > &g

[PHP] datetime

2003-04-03 Thread Tim Haskins
How does one retrieve the date and time off a server in the following format? 2003-04-03 11:11:38 I've read much on date and time regarding php and mysql but could not figure out the above format...please help -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] datetime convert

2002-09-12 Thread Alex Shi
Hi, I'm trying to convert a formated datetime string into a timestamp. The string format is "Y-m-d H:i:s". I use strtotime() to convert the datetime string. However, the converted datetime seems lost its time part. Is there any easy solution to make the converting? Thanks in advance! Alex --

Re: [PHP] datetime field - still a newbie

2002-07-25 Thread Alexander Ross
Thanks bunches "John Holmes" <[EMAIL PROTECTED]> wrote in message 001101c233ba$3de3d430$b402a8c0@mango">news:001101c233ba$3de3d430$b402a8c0@mango... > > I have a datetime field in one of my mysql tables...when displaying > some > > of > > my records I want to display the date in the aforemention

RE: [PHP] datetime field - still a newbie

2002-07-25 Thread John Holmes
> I have a datetime field in one of my mysql tables...when displaying some > of > my records I want to display the date in the aforementioned datetime > field, > but if the date is today I want to display "today" instead. If the date > is > yesterday I want it to display that so I how do I c

RE: [PHP] datetime field - still a newbie

2002-07-24 Thread David Freeman
> I have a datetime field in one of my mysql tables...when > displaying some of > my records I want to display the date in the aforementioned > datetime field, > but if the date is today I want to display "today" instead. > If the date is > yesterday I want it to display that so I

[PHP] datetime field - still a newbie

2002-07-24 Thread Alexander Ross
I have a datetime field in one of my mysql tables...when displaying some of my records I want to display the date in the aforementioned datetime field, but if the date is today I want to display "today" instead. If the date is yesterday I want it to display that so I how do I compare the dat

[PHP] datetime on MSSQL doesn't work with PHP

2001-07-08 Thread Christian Dechery
why does PHP converts the 'datetime' and 'smalldatetime' types of MSSQL to a 'prettier' output? in the table I have '2001-07-01 12:45:01' but when I run a query in PHP to get it I recieve 'Jul 7 2001 12:45AM'. I didn't ask for that... I want the exact value in the field with seconds and all, n