Convert String to Date and Add ±N Hours

Vahid sabeti.ltd at gmail.com
Sat Nov 4 18:11:53 UTC 2023


Hi,

I have a date string with the format of "2023-11-04 23:10:20". I 
want to convert this string to Date object and also, add ±N hours 
to it. For example:

`"2023-11-04 23:10:20" + "+2:00" = "2023-11-05 01:10:20"`
`"2023-11-04 23:10:20" + "-2:30" = "2023-11-05 20:40:20"`

How can I do this?


More information about the Digitalmars-d-learn mailing list