You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (if I'm reading the docs right) there's no way to parse just a TimeZone/Offset using the formats described in format::strftime.
I have a use case to parse an Offset, e.g., "UTC-0700" and return a DateTime object at midnight of the current day at that offset, essentially replicating the behaviour of date -d "UTC-0700". I have a workaround to have a default datetime string, and append the offset to be parsed to it, and then use DateTime::parse_from_str - is that the only way to do this at the moment?
Obviously no obligation to consider this as a feature, just wondering if there were any other standard ways for parsing Timezones/Offsets at the moment, or if it was on anyone's mind.
The text was updated successfully, but these errors were encountered:
Currently (if I'm reading the docs right) there's no way to parse just a TimeZone/Offset using the formats described in
format::strftime
.I have a use case to parse an Offset, e.g.,
"UTC-0700"
and return a DateTime object at midnight of the current day at that offset, essentially replicating the behaviour ofdate -d "UTC-0700"
. I have a workaround to have a default datetime string, and append the offset to be parsed to it, and then useDateTime::parse_from_str
- is that the only way to do this at the moment?Obviously no obligation to consider this as a feature, just wondering if there were any other standard ways for parsing Timezones/Offsets at the moment, or if it was on anyone's mind.
The text was updated successfully, but these errors were encountered: