blob: 8c7dffc1aaa6b06b9bac1720e709f57d923382ab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
namespace Xmpp.Xep.DateTimeProfiles {
public DateTime? parse_string(string time_string) {
TimeVal time_val = new TimeVal();
if (time_val.from_iso8601(time_string)) {
return new DateTime.from_unix_utc(time_val.tv_sec);
}
return null;
}
public string to_datetime(DateTime time) {
return time.to_utc().format("%Y-%m-%dT%H:%M:%SZ");
}
}
|