php datetime custom formatting -
i'm trying use
format("m/d/y \a\\t h:ia t");
to get
05/14/15 @ 04:22am mdt
which used work of sudden i'm getting
exception: datetime::__construct() [datetime.--construct]: failed parse time string (05/14/15 @ 04:22am mdt) @ position 9 (a): timezone not found in database in some/folders/and.files on line x
so work around taking "at" out
format('m/d/y h:ia t');
i've found can leave \a
in no problem \a\\t
causes error. on how past this?
**edit
the timestamp being passed in generated mysql
2015-05-14 10:22:41
**edit
this accepted answer didn't solve problem me. issue unique server / application once figure out on own i'll post here avoid further downvotes.
i'm working lot of data , lot of files (classes) thing working couldn't paste code in here or else no 1 @ question. so here's skinny on happening:
inside of loop time value getting replaced formatted value , getting caught in same loop, hence why getting error , thought getting time incorrect value because (the first time okay not on re-run).
resolution
when in doubt, print out time value going datetime->format
, may surprised it's not think is.
Comments
Post a Comment