We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7448df3 commit e2d6fffCopy full SHA for e2d6fff
2 files changed
LinePutScript/SetObject.cs
@@ -267,7 +267,18 @@ public DateTime GetDateTime()
267
case ObjectType.Float:
268
return new DateTime((long)(double)Value);
269
case ObjectType.String:
270
- return DateTime.Parse((string)Value);
+ if (long.TryParse((string)Value, out long r))
271
+ {
272
+ return new DateTime(r);
273
+ }
274
+ else if (DateTime.TryParse((string)Value, out DateTime result))
275
276
+ return result;
277
278
+ else
279
280
+ return DateTime.MinValue;
281
282
case ObjectType.Boolean:
283
return (bool)Value ? DateTime.MaxValue : DateTime.MinValue;
284
case ObjectType.DateTime:
nuget/LinePutScript.1.5.2.nupkg
209 KB
0 commit comments