CharacterArray.st
changeset 17021 c7ac4c24c541
parent 17000 28e08401d7ae
child 17024 f0ef2620b98b
--- a/CharacterArray.st	Mon Nov 10 18:08:04 2014 +0100
+++ b/CharacterArray.st	Mon Nov 10 18:18:01 2014 +0100
@@ -3303,6 +3303,20 @@
     "Created: 12.5.1996 / 10:41:14 / cg"
 !
 
+asTimestamp
+    "convert the receiver into an Timestamp.
+     Notice, that errors may occur during the read,
+     so you better setup some exception handler when using this method."
+
+    ^ Timestamp readFromString:self
+
+    "
+     '2014-11-10 21:30:22.444' asTimestamp
+     '2014-11-10 21:30:22.444Z' asTimestamp
+     '2014-11-10 21:30:22.444+0200' asTimestamp
+    "
+!
+
 asTitlecase
     "return a version of the receiver, where the first character is converted to titlecase,
      and everything else to lowercase.
@@ -3514,6 +3528,18 @@
     "
 !
 
+asUtcTimestamp
+    "convert the receiver into an UtcTimestamp (Time is interpreted in the UTC timezone).
+     Notice, that errors may occur during the read,
+     so you better setup some exception handler when using this method."
+
+    ^ UtcTimestamp readFromString:self
+
+    "
+     '2014-11-10 21:30:22.444' asUtcTimestamp
+    "
+!
+
 literalArrayEncoding
     "encode myself as an array literal, from which a copy of the receiver
      can be reconstructed with #decodeAsLiteralArray."
@@ -5568,6 +5594,7 @@
     "Modified: 17.4.1997 / 12:50:23 / cg"
 ! !
 
+
 !CharacterArray methodsFor:'special string converting'!
 
 asUnixFilenameString
@@ -7142,11 +7169,11 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.547 2014-11-08 09:35:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.548 2014-11-10 17:18:01 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.547 2014-11-08 09:35:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.548 2014-11-10 17:18:01 stefan Exp $'
 ! !