prudens Posted March 2, 2008 Share Posted March 2, 2008 Hey, so i have this $date = 01012008, how do I echo it in the format of 01-01-2008? Thanks Link to comment https://forums.phpfreaks.com/topic/93941-format-01012008-to-01-01-2008/ Share on other sites More sharing options...
plodos Posted March 2, 2008 Share Posted March 2, 2008 try this, but also it depends on your server time!!! $now = time(); $date = date("d/m/Y H:i:s",$now); Link to comment https://forums.phpfreaks.com/topic/93941-format-01012008-to-01-01-2008/#findComment-481319 Share on other sites More sharing options...
AndyB Posted March 2, 2008 Share Posted March 2, 2008 @ plodos: what's the connection between your reply and the original question. @ prudens: avoid imaginary date strings like the plague. Use a rational date format (the ISO yyyy-mm-dd is ideal) and format the date to your liking before displaying it. Link to comment https://forums.phpfreaks.com/topic/93941-format-01012008-to-01-01-2008/#findComment-481326 Share on other sites More sharing options...
prudens Posted March 2, 2008 Author Share Posted March 2, 2008 Well, any way to format it? I wish to save that extra 2 byte space... I only have 10mb of SQL space... I'm already using 9.5mb. Link to comment https://forums.phpfreaks.com/topic/93941-format-01012008-to-01-01-2008/#findComment-481346 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.