[FX.php List] Date Format

DC dan.cynosure at dbmscan.com
Thu Nov 16 08:26:14 MST 2006


oops, sorry, rereading that made me realize that wasn't too clear....

the only problem in this code is that you need to switch the $m and  
$d variables in the *first* line because otherwise the list explode  
construction will assign the day to $m and the month to $d.

HTH,
dan

On Nov 16, 2006, at 10:19 AM, DC wrote:

> btw, there is a small "locale" error in this code... the date  
> presented as an example is in european format of dd/mm/yyyy. this  
> code treats it as if it is american style mm/dd/yyyy
>
> just switch order of $m and $d variables and the j and F date  
> format string and the code will work for european style dates.
>
> dan
>
> On Nov 16, 2006, at 4:46 AM, Gjermund Gusland Thorsen wrote:
>
>> list( $m, $d, $y ) = explode( '/', $value['datefield'][0] );
>> echo date( "j F Y", mktime( 0, 0, 0, $m, $d, $y ) );
>>
>> ggt667
>>
>> 2006/11/16, Roger Price <rp272 at cam.ac.uk>:
>>>
>>>
>>> I am new to PHP and FX.php in particular.
>>>
>>> In FMP I have a date field which is set to say: 16/11/2006. I  
>>> would like to
>>> display this on a web page as 16 November 2006.
>>>
>>> I'm sure that this must be a very common question but I cannot  
>>> find a simple
>>> solution anywhere. If I need the date in 'timestamp' format do I  
>>> have to
>>> calculate this in FMP?  I tried formatting the field in FMP but  
>>> of course
>>> this does not translate to the web!
>>>
>>> I would appreciate any help
>>>
>>> Roger
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>>
>>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list