indyng
asked on
How can I get the format ddd-mmm-yy hh:mm AMPM from dd/mm/yy hh:mm:ss AMPM?
Hi Experts,
How can I get the format ddd,mmm-dd,yyyy hh:mm AMPM from dd/mm/yy hh:mm:ss AMPM?
I want it to look like this:
Wed, Apr-05,2005 12:00 PM from 05/04/05 12:00:00 PM
THANKS
How can I get the format ddd,mmm-dd,yyyy hh:mm AMPM from dd/mm/yy hh:mm:ss AMPM?
I want it to look like this:
Wed, Apr-05,2005 12:00 PM from 05/04/05 12:00:00 PM
THANKS
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have
Response.Write WeekdayName(DatePart("W", Now),1) & ", " & MonthName(Month(Now), True) & "-" & Day(Now()) & ", " & Year(Now) & " " & "<br>"
But I just need the time in hh:nn AMPM.
Thanks
Response.Write WeekdayName(DatePart("W", Now),1) & ", " & MonthName(Month(Now), True) & "-" & Day(Now()) & ", " & Year(Now) & " " & "<br>"
But I just need the time in hh:nn AMPM.
Thanks
you've got the simplest way to do it. I'm sure there is a way, maybe using Mid to get rid of the seconds. Possibly even using regExp.
I'll see if I can come up with something along those lines
I'll see if I can come up with something along those lines
The examples are my function:
datepart("h", now) & ":" & datepart("n", now)
but you should use the leadingZero function to make sure the time doesn't look like 3:5 for five minutes past three in the morning.
leadingZero(datepart("h", now)) & ":" & leadingZero(datepart("n", now))
To be honest, it doesn't get much more simple than being given a whole function to cut and paste into your script and the usage examples to use it!..
datepart("h", now) & ":" & datepart("n", now)
but you should use the leadingZero function to make sure the time doesn't look like 3:5 for five minutes past three in the morning.
leadingZero(datepart("h", now)) & ":" & leadingZero(datepart("n", now))
To be honest, it doesn't get much more simple than being given a whole function to cut and paste into your script and the usage examples to use it!..
i semi-agree with Cirieno.
to use mine like you want it:
FormatDate("D, M-d,Y g:i A", NOW())
however I'm looking around for something a bit "easier" by using regExp
to use mine like you want it:
FormatDate("D, M-d,Y g:i A", NOW())
however I'm looking around for something a bit "easier" by using regExp
ASKER
kevp75 ,
I tried your script and got this error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'lDtmNow'
/intermodal/shipment_track er/functio ns/MyDateF ormat.txt, line 90
line 90 is:
lLngSecond = Second(lDtmNow)
Thanks
I tried your script and got this error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'lDtmNow'
/intermodal/shipment_track
line 90 is:
lLngSecond = Second(lDtmNow)
Thanks
odd.
FormatDate("D, M-d,Y g:i A", NOW()) for me puts out Fr13, PMpr-07,2006 12:13 PM
see:http://www.portalfanatic.com/test14.asp
FormatDate("D, M-d,Y g:i A", NOW()) for me puts out Fr13, PMpr-07,2006 12:13 PM
see:http://www.portalfanatic.com/test14.asp
ASKER
Thanks