Jump to content

date class


This topic is 7859 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Here is a subroutine that will take the AppleScript date and convert it to a text string that FileMaker will interpret as a date. It will automatically adjust for US or European time formats. [ A complete description of the subroutine can be found at http://www.macadillo.com/ATW/shortdate.html ]

on FormatDate(theDate)

set thisDay to text -2 thru -1 of ("0" & day of theDate)

copy theDate to b

set month of b to January

set thisMonth to text -2 thru -1 of ("0" & (1 + (theDate - b + 1314864) div 2629728))

try

word 2 of (theDate as string) as integer -- will error on US date format

set theFirstPart to thisDay & "/" & thisMonth

on error

set theFirstPart to thisMonth & "/" & thisDay

end try

set theShortDate to theFirstPart & "/" & (year of theDate) as text

return theShortDate

end FormatDate

Link to comment
Share on other sites

This topic is 7859 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.