Permalink
Browse files

Add a simple README

  • Loading branch information...
1 parent 9226d45 commit 2563f7569ea78241d69ecc6d9cdbdcf0bda0bc09 Devin Torres committed Jan 3, 2012
Showing with 29 additions and 0 deletions.
  1. +29 −0 README.md
View
@@ -0,0 +1,29 @@
+A class representation of a date and time. It's basically a wrapper around
+the Date javascript object, KVO-friendly and with common date/time
+manipulation methods.
+
+This object differs from the standard JS Date object, however, in that it
+supports time zones other than UTC and that local to the machine on which
+it is running. Any time zone can be specified when creating an
+`Ember.DateTime` object, e.g.
+
+```javascript
+ // Creates a DateTime representing 5am in Washington, DC and 10am in
+ // London
+ var d = Ember.DateTime.create({ hour: 5, timezone: 300 }); // -5 hours from UTC
+ var e = Ember.DateTime.create({ hour: 10, timezone: 0 }); // same time, specified in UTC
+```
+
+and it is true that `d.isEqual(e)`.
+
+The time zone specified upon creation is permanent, and any calls to
+`get()` on that instance will return values expressed in that time zone. So,
+
+ d.hour returns 5.
+ e.hour returns 10.
+
+but
+
+ d.milliseconds === e.milliseconds
+
+is true, since they are technically the same position in time.

0 comments on commit 2563f75

Please sign in to comment.