> -----Original Message-----
> From: Vasu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 15, 2001 1:53 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] date conversion
>
>
> Hi,
>
> I am trying to get US date out of a DATETIME column but it
> returns "12/31/1969".  The line of code that I am using is:
>
> <?php echo date("m/d/Y", $Row->FileSentDate); ?>

in php u can convert it via:

int mktime (int hour, int minute, int second, int month, int day, int year
[, int is_dst])

the return-value is unix-timestamp


> According to the documentation, the second parameter of the
> date() function requires timestamp value which is int data type.
> If any of you know how to convert a value into timestamp or any
> other solution to get US date out of a string or DATETIME column,

u can also use a simple SQL-Query (i.e. in MySQL):

"SELECT UNIX_TIMESTAMP(datetimefield) AS unixtime FROM table"

so SQL return a unix-timestamp instead of a pre-formated datetime string ;)

> please let me know.
>
> Thanks for your help.
>
>
> Vasu

Hopes this solves your probs ;)

CodeDuck


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to