• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Value of a date in Numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Value of a date in Numbers


  • Subject: Re: Value of a date in Numbers
  • From: Michelle Steiner <email@hidden>
  • Date: Tue, 3 Feb 2009 17:58:14 -0700

On Feb 3, 2009, at 9:31 AM, Luther Fuller wrote:

I think this is a feature. (In fact, I would think recording time locally would be a bug.) Here's why.

The things (files, folders, &c.) on your computer have a date (or two) associated with them. If you have a portable, these dates may have been associated with your files in many different time zones. If you have moved files from other computers onto your computer, the associated date originates in many different zones.

Dates are mainly used in two ways: to be displayed and to be calculated. A displayed date should be displayed in the local time zone. Calculated dates (including date comparison), on the other hand, need to be independent of any time zone.

In order to avoid always having to convert to some common time zone, recorded dates should always be in UTC (Coordinated Universal Time, related to GMT). If you need to compare dates, you just compare them without having to convert dates.

However, if you use Applescript to get a date-time from Numbers and enter it into iCal, the time will be off by the offset from GMT.


For instance, using code snippets.

set x to contents of cell "B5" --of a table in Numbers
make new event with properties {start date: x} -- in iCal
Assuming that the computer is set to Mountain Standard Time:

If the displayed date/time in Numbers is Feb 4, 8 PM
Applescript will return
date "Wednesday, February 4, 2009 1:00:00 PM"

the start date in iCal will be Feb 4, 1 PM

Numbers treats the time in the cell as GMT time and automatically converts it to local time when passing it to Applescript, but when Applescript uses that time in iCal, iCal accepts it as local time.

if the displayed start time of an event is 6 PM, it will pass it to Applescript as 6 PM, regardless of what time zone the computer is set for.

-- Michelle

--
Patient: But doctor, slow metabolism runs in my family.

Doctor: The problem is nobody runs in your family!


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Value of a date in Numbers
      • From: Luther Fuller <email@hidden>
References: 
 >Value of a date in Numbers (From: Michelle Steiner <email@hidden>)
 >Re: Value of a date in Numbers (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Value of a date in Numbers
  • Next by Date: Value of an empty cell in Numbers
  • Previous by thread: Re: Value of a date in Numbers
  • Next by thread: Re: Value of a date in Numbers
  • Index(es):
    • Date
    • Thread