diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2024-02-13 15:47:07 +0100 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2024-02-16 17:11:31 +0100 |
| commit | ac382bd9aaff68be786c5e8b1ded7d91f3369887 (patch) | |
| tree | 44a74ba475d77168ffb7cf09d9a69c2b9d984331 /src/qml/jsruntime/qv4dateobject.cpp | |
| parent | 31a60b518bd7d811172b887501e831e6e4e4a9c1 (diff) | |
Clean up and clarify Date's ParseString's comment
The comment on the supported formats used a notation for date-time
formats that doesn't match what QDateTime and friends use. So amend to
match that and make clear (by repeating parts of the format in the
explanation, where their fields are named) what the various fields
mean.
Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-62111
Change-Id: I9926bbc11efe14c01df8fb538121acdb2ee18b1d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index d168517901..6b64be3abb 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -315,14 +315,14 @@ static inline double ParseString(const QString &s, double localTZA) First, try the format defined in ECMA 262's "Date Time String Format"; only if that fails, fall back to QDateTime for parsing - The defined string format is YYYY-MM-DDTHH:mm:ss.sssZ; the time (T and all - after it) may be omitted; in each part, the second and later components - are optional; and there's an extended syntax for negative and large - positive years: +/-YYYYYY; the leading sign, even when +, isn't optional. - If month or day is omitted, it is 01; if minute or second is omitted, it's - 00; if milliseconds are omitted, they're 000. - - When the time zone offset is absent, date-only forms are interpreted as + The defined string format is yyyy-MM-ddTHH:mm:ss.zzzt; the time (T and all + after it) may be omitted. In each part, the second and later components + are optional. There's an extended syntax for negative and large positive + years: ±yyyyyy; the leading sign, even when +, isn't optional. If month + (MM) or day (dd) is omitted, it is 01; if minute (mm) or second (ss) is + omitted, it's 00; if milliseconds (zzz) are omitted, they're 000. + + When the time zone offset (t) is absent, date-only forms are interpreted as indicating a UTC time and date-time forms are interpreted in local time. */ |
