Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Adding Time to Date
Noura_Almazrouei_(nalmazrouei_-_(deleted))
i have a statement now = Date.StringtoDate(dudt_str, "%d/%m/%y")its working fine. Now i want to add time to it.I have tried now = Date.StringtoDate(dudt_str, "%d/%m/%y/%h")but it give me error "Server did not respond".Please tell me exact syntax to include time.
Find more posts tagged with
Comments
Donna Nalls
what is the value of your dudt_str variable?also, you may want to use %Y to include the 4 digit year.Check your online Help under Date Class....i don't see %h as a conversion option...i see only %H and you will need to use two characters in your hour string. i.e.dudt_str = "30/05/2005/02:15"now = Date.StringToDate(dudt_str, '%d/%m/%Y/%H:%M')returns: D/2005/5/30:2:15:0Best,Donna
Donna Nalls
Also, it is not likely that the block of code you have shown has caused the "Server Did Not Respond" error...it is likely whatever you are doing with the date variable after this....Date.StringToDate() will return undefined if it is not able to properly convert the string - so, check to make sure your date is properly defined before using it.if isDefined(now) ....end