VASmalltalk – Repairing DateAndTime with ICU

I uploaded version 0.0.3 to vastgoodies.com and here are some simple examples to fix all these bugs I mentioned in my earlier posting.

To get a correct DateAndTime instance with the current local date/time I added DateAndTime class>>currentLocalDateAndTime. This method uses ICU and creates a correctly initialized DateAndTime instance and returns this.

By querying DateAndTime currentLocalDateAndTime offset hours you get the offset from UTC to that current time in hours.

Another convenient method is DateAndTime class>>currentUTCDateAndTime, which returns a correctly initialized DateAndTime instance for the current UTC time (with a correct offset).

Advertisement
This entry was posted in Smalltalk and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.