• 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: Number of days left in the month
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number of days left in the month


  • Subject: Re: Number of days left in the month
  • From: Emmanuel <email@hidden>
  • Date: Thu, 21 Nov 2002 11:01:18 +0100

At 6:59 PM -0500 20/11/02, Marc K. Myers wrote:
Date: Wed, 20 Nov 2002 10:21:43 -0700
Subject: Number of days left in the month
From: Michelle Steiner <email@hidden>
To: email@hidden

Someone asked (on the A'script newsgroup) how to figure out how many
days are left in the current month, or how to compute the total number
of days in the current month.

A while back I came up with a similar but slightly more compact way of calculating the remaining days:

set theDiff to ((((date daysRemaining()) + days) - (current date)) / days) div 1

on daysRemaining()
set lastDay to {"31", "30", "29", "28"}
repeat with i in lastDay
try
date i
return i
end try
end repeat
end daysRemaining

Still more compact:

================
48 - (day of ((date ("" & 1)) + 4060800))
================
--> 30

Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Number of days left in the month
      • From: Mail Lists Out <email@hidden>
References: 
 >Re: Number of days left in the month (From: "Marc K. Myers" <email@hidden>)

  • Prev by Date: Re: illustrator: how to kill these legends?
  • Next by Date: Re: AppleScript 1.6 and Mac OS 8.6 - SOLVED
  • Previous by thread: Re: Number of days left in the month
  • Next by thread: Re: Number of days left in the month
  • Index(es):
    • Date
    • Thread