Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Conncet-IT : Date+time conversion

Highlighted
shilpa gowda
Regular Collector

Conncet-IT : Date+time conversion

Hi Experts,

I have to convert the text input date in the format like "Fri Oct 08 12:34:00 IST 2010" to
"10/10/08 12:34:00"

Please let me know, how it can be converted.

Regards,
Shilpa
1 REPLY
shilpa gowda
Regular Collector

Re: Conncet-IT : Date+time conversion

Hi Experts,

I have created user format for the date+time in the previous post,

I created a date format which is of the way the input is from NNM like "Sun Oct 10 11:00:00 IST 2010"="ddd' 'mmm' 'd' 'hh':'nn':'ss' ''I''S''T'' 'yyyy"=nnm

and nnm1="yy'/'mm'/'d' 'hh':'nn':'ss"

and i treid the functns as below,

Dim d,e as Variant
d=PifUserFmtVarToStr([Column 8],"nnm")
e=PifUserFmtStrToVar(d,"nnm1")
RetVal=e

This throughs an error:
The field 'Month' with value '' in ' Fri Oct 08 20:23:35 IST 2010 ' is too short. A minimum of 1 character(s) is needed.
Cannot convert ' Fri Oct 08 20:23:35 IST 2010 ' (type text) to date and time type (invalid value).
Runtime error - Application defined or object defined error.

thn i tried :
Dim d,e as Variant
d=PifUserFmtVarToStr([Column 8],"nnm")
RetVal=FormatDate(d,"nnm1")
This doesnt return any value at all.

Can you please help me with this? ASAP
//Add this to "OnDomLoad" event