[FX.php List] Formatting FMP Dates and Times?
Joel Shapiro
jsfmp at earthlink.net
Mon Jun 19 12:37:26 MDT 2006
My hero.
Thanks Andy!
I'd tried strtotime(), but not together with Date() and/or Time().
It's just what I was looking for.
Best,
-Joel
On Jun 19, 2006, at 10:59 AM, Andy Gaunt wrote:
> Joel,
>
> Try wrapping your field in strtotime()
>
> Date('l n/j/y', strtotime($TData['DateA'][0]));
>
> Same for your time too.
>
> Andy Gaunt
> T: 407.810.4722
> andy at fmpug.com
> http://www.fmpug.com
>
> Recipient of FileMaker's 2005 "Mad Dog" Public Relations Award
>
> For chapter locations, dates & times please visit the website at
> http://www.fmpug.com If you can make it to a meeting, please RSVP at
> http://www.fmpug.com/rsvp.php
>
> -----Original Message-----
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Joel
> Shapiro
> Sent: Monday, June 19, 2006 1:54 PM
> To: FX.php Discussion List
> Subject: [FX.php List] Formatting FMP Dates and Times?
>
> Hi all
>
> I'm trying to figure out how to format dates and times that are
> coming from FileMaker. I've been looking through php.net at Date()
> and Time() (as well as related functions; & google) but can't get the
> functions to work with my FMP data. They seem to either read the
> current Unix timestamp, or 12/31/1969.
>
> DateA and TimeA are date and time fields in FMP.
>
> DATES:
> $TData['DateA'][0] // displays as 07/01/2006 (correct, but I'd like
> the day)
> Date($TData['DateA'][0]) // displays as 07/01/2006 (same)
> Date('l n/j/y',$TData['DateA'][0]) // displays as Wednesday
> 12/31/69 (formatting OK but wrong date)
>
> TIMES:
> $TData['TimeA'][0] // displays as 10:00:00 (correct, but I'd like
> 10:00 am)
> Time($TData['TimeA'][0]) // displays as 1150684018 (Unix timestamp?)
> Date($TData['TimeA'][0]) // displays as 10:00:00
> Date('g:i a',$TData['TimeA'][0]) // displays as 4:00 pm (some
> timestamp??, but correct formatting)
>
> Can PHP format dates and times that aren't current Unix timestamps?
> Any suggestions?
>
> TIA,
> -Joel
> _______________________________________________
> 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