• 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: Deivy Petrescu <email@hidden>
  • Date: 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”


Deivy Petrescu
email@hidden




 _______________________________________________
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: Calculate Current Year Quarter with Time Zone Using AppleScriptObjC
      • From: Shane Stanley <email@hidden>
References: 
 >Calculate Current Year Quarter with Time Zone Using AppleScriptObjC (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Finder Renaming Unpleasant Surprise
  • Next by Date: NS Keywords
  • Previous by thread: Re: Calculate Current Year Quarter with Time Zone Using AppleScriptObjC
  • Next by thread: Re: Calculate Current Year Quarter with Time Zone Using AppleScriptObjC
  • Index(es):
    • Date
    • Thread