@@ -49,30 +49,25 @@ to-idate: func [
49
49
]
50
50
]
51
51
52
- to-date: wrap [
53
- digit: charset [#"0" - #"9" ]
54
- alpha: charset [#"a" - #"z" #"A" - #"Z" ]
55
- function [
56
- "Converts to date! value."
57
- value [any-type! ] "May be also a standard Internet date string/binary"
58
- /utc "Returns the date with UTC zone"
59
- ][
60
- if all [
61
- any [string? value binary? value]
62
- parse value [
63
- 5 skip
64
- copy day: 1 2 digit space
65
- copy month: 3 alpha space
66
- copy year: 1 4 digit space
67
- copy time: to space space
68
- copy zone: to end
69
- ]
70
- ][
71
- if zone = "GMT" [zone: "+0" ]
72
- value: to string! rejoin [day "-" month "-" year "/" time zone]
52
+ to-date: function/with [
53
+ "Converts to date! value."
54
+ value [any-type! ] "May be also a standard Internet date string/binary"
55
+ /utc "Returns the date with UTC zone"
56
+ ][
57
+ if all [
58
+ any [string? value binary? value]
59
+ parse value [
60
+ 5 skip
61
+ copy day: 1 2 numeric sp
62
+ copy month: 3 alpha sp
63
+ copy year: 1 4 numeric sp
64
+ copy time: to sp sp
65
+ [copy zone: [plus-minus 4 numeric] | no-case "GMT" (zone: "+0" )]
66
+ to end ; ignore the rest (like comments in mime fields)!
73
67
]
74
-
75
- if all [value: to date! value utc] [ value/timezone: 0 ]
76
- value
68
+ ][
69
+ value: to string! rejoin [day "-" month "-" year "/" time any [zone "" ]]
77
70
]
78
- ]
71
+ if all [value: to date! value utc] [ value/timezone: 0 ]
72
+ value
73
+ ] system/catalog/bitsets
0 commit comments