FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » date parsing
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: date parsing [message #175392 is a reply to message #175387] Tue, 13 September 2011 23:40 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 9/13/2011 4:53 PM, bob wrote:
> I need to convert this Java code to php ASAP:
>
> static String processDate(String s){
> Format formatter = new SimpleDateFormat(
> "E, dd MMM yyyy HH:mm:ss Z");
> Date date = null;
> try {
> date = (Date) formatter.parseObject(s);
> } catch (ParseException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> SimpleDateFormat sdf = new SimpleDateFormat(
> "h:mm aaa - EEEEE, MMM dd, yyyy ");
> String myString = sdf.format(date);
> return myString;
> }
>
> Any tips?

Sorry, my Java is a bit rusty.

Find out the input format, the desired output format, and create a
function to do it like you want.

Something like this I generally don't even try to match the code from
another language.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Notice: Undefined index: action error please help
Next Topic: What would you like to see in most in a text editor?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 02:32:45 GMT 2024

Total time taken to generate the page: 0.06273 seconds