• 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: Daylight Saving bug in Numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Daylight Saving bug in Numbers


  • Subject: Re: Daylight Saving bug in Numbers
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 01 Apr 2016 17:49:36 +0200

This short script show the different results which we may get when working with datetime driving Numbers thru AppleScript.

time to GMT # as we are in Summer time, in France it will be 3600 * 2 aka 2 hours
log result (*7200*)


# Build a date according to the host settings in winter time
set theDate to "12/12/12"
set theDate to date theDate
set year of theDate to 2016
set month of theDate to 3
set day of theDate to 22
set theDate to short date string of theDate
log result (*22/03/2016*)

tell application "Numbers"
tell table 1 of sheet 1 of front document
set value of cell "A1" to theDate
set value of cell "B1" to "= " & quote & quote & "&A1"
get value of cell "A1"
log result (*date lundi 21 mars 2016 23:00:00*)
date string of (get value of cell "A1")
log result (*lundi 21 mars 2016*)
get formula of cell "B1"
log result (*= ""&A1*)
get value of cell "B1"
log result (*2016-03-22 00:00*)
tell me to set theDate to date theDate
log result (*date mardi 22 mars 2016 00:00:00*)
set value of cell "A2" to theDate
set value of cell "B2" to "= " & quote & quote & "&A2"
get value of cell "A2"
log result (*date mardi 22 mars 2016 00:00:00*)
date string of (get value of cell "A2")
log result (*mardi 22 mars 2016*)
get formula of cell "B2"
log result (*= ""&A2*)
get value of cell "B2"
log result (*2016-03-22 01:00*)
end tell
end tell

# Build a date according to the host settings in summer time
set theDate to "12/12/12"
set theDate to date theDate
set year of theDate to 2016
set month of theDate to 3
set day of theDate to 29
set theDate to short date string of theDate
log result

tell application "Numbers"
tell table 1 of sheet 1 of front document
set value of cell "A3" to theDate
set value of cell "B3" to "= " & quote & quote & "&A3"
get value of cell "A3"
log result (*date mardi 22 mars 2016 00:00:00*)
date string of (get value of cell "A3")
log result (*mardi 29 mars 2016*)
get formula of cell "B3"
log result (*= ""&A3*)
get value of cell "B3"
log result (*2016-03-29 00:00*)
tell me to set theDate to date theDate
log result (*date mardi 29 mars 2016 00:00:00*)
set value of cell "A4" to theDate
set value of cell "B4" to "= " & quote & quote & "&A4"
get value of cell "A4"
log result (*date mardi 29 mars 2016 00:00:00*)
date string of (get value of cell "A4")
log result (*mardi 29 mars 2016*)
get formula of cell "B4"
log result (*= ""&A4*)
get value of cell "B4"
log result (*29/03/2016 00:00*)
end tell
end tell

So, if we need to be able to extract the value which we inserted, my understanding is that we must insert a string value and use the auxiliary column with the formula =""&A1


Yvan KOENIG running El Capitan 10.11.4 in French (VALLAURIS, France) vendredi 1 avril 2016 17:49:29



 _______________________________________________
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

  • Next by Date: Re: What is AcroExt?
  • Next by thread: Re: Daylight Saving bug in Numbers
  • Index(es):
    • Date
    • Thread