• 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: Calculate Current Year Quarter with Time Zone Using AppleScriptObjC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculate Current Year Quarter with Time Zone Using AppleScriptObjC


  • Subject: Re: Calculate Current Year Quarter with Time Zone Using AppleScriptObjC
  • From: Nigel Garvey <email@hidden>
  • Date: Sat, 14 Jan 2017 19:22:02 +0000

Deivy Petrescu wrote on Sat, 14 Jan 2017 09:43:22 -0500:

>> On Jan 14, 2017, at 24:17 , Christopher Stone <email@hidden> wrote:
>>
>> use framework "Foundation"
>> -------------------------------------------------------------------------------------------
>>
>> set currentCalendar to current application's NSCalendar's currentCalendar()
>> set theTimeZone to current application's NSTimeZone's
>>timeZoneWithName:"US/Central"
>> set currentCalendar's timeZone to theTimeZone
>> set currentMonth to (currentCalendar's component:(current application's NSCalendarUnitMonth) fromDate:(current application's NSDate's |date|)) as integer
>> set currentQuarter to (((currentMonth - 1) div 3 + 1) as text) & "Q"
>>
>
>
>or
>
>return ((((month of (current date)) - 1) div 3 + 1) as string) & " Q”

Hi both.

((currentMonth - 1) div 3 + 1) could be ((currentMonth + 2) div 3)


NG

 _______________________________________________
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


  • Prev by Date: Re: NS Keywords
  • Next by Date: Re: NS Keywords
  • Previous by thread: Re: NS Keywords
  • Next by thread: Asking a favour, please?
  • Index(es):
    • Date
    • Thread