1
ouioui
FormTextDateSelect / datetime from mysql
  • 2005/5/17 13:27

  • ouioui

  • Just popping in

  • Posts: 32

  • Since: 2003/7/11


Hi,

I try to exploit the FormTextDateSelect with a "datetime" field from a MySQL DB.
The value of datetime field is '2005-05-01 00:00:00' ($mydate in the folowing code).


$f_date = new XoopsFormTextDateSelect(_FO_DATE, 'date', 15,$mydate);


In the contructor of FormTextDateSelect class there is this code :

$value = !is_numeric($value) ? time() : intval($value);


As my field is not numeric i have everytime the current date.
I don't found the php function to convert my field '2005-05-01 00:00:00' in a numeric field witch can be interstanding by the calendar. Can you help me ?

I want to convert in a french format. Is there is a documentation about ?

2
Mithrandir
Re: FormTextDateSelect / datetime from mysql

$value = strtotime($mydate);

XOOPS uses UNIX timestamps for dates.

Login

Who's Online

212 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 212


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits