Hi All, I found this in the archive and wanted to know if there was an option to get the date from two days in the future. I'm trying to make script that will look ahead for what the month and day will be in numerical format. I'm using the shell script "date" to get the current date, but I want to get that same info as + 2 days.
Does anybody know how to do this? I like the terminal / shell options rather than changing the text item delimiters, sorting out, etc. But you gotta work with what you have.
Any advice is apperciated!
Chris
On May 26, 2005, at 6:00 PM, Mark J. Reed wrote: What Gnarlie said. The UNIX date(1) command's time-formatting feature lets you do whatever you want, even if the field keys are a little cryptic. You can get a full list by typing "man date" or "man strftime" in a terminal window, but here are the basics. set formattedDateString to (do shell script "date +'...format string goes here...'") where format string can include anything you like, with placeholders for the parts to be replaced by the date values: %% to get a literal percent sign if you need one %y to get the two-digit year %Y to get the four-digit year %m to get the month number (1-12) %b to get the short month name (Jan, Feb, Mar,... in English) %B to get the long month name (January, February, March,... in English) %d to get the day of the month (1-31) %H to get the hour in 24-hour time (0-23) %I to get the hour in 12-hour time (1-12) %p to get an AM/PM indicator to go with %I %M to get the minute of the hour %S to get the second of the minute %Z to get the time zone label If you want to throw in the weekday, it's %a for the short name (Sun, Mon, Tue... in English) and %A for the long name (Sunday, Monday, Tuesday,... in English). So if you want yyyy/mm/dd it's do shell script "date +'%Y/%m/%d'"
On 5/26/05, Gnarlodious <email@hidden> wrote: Entity Jack Stewart spoke thus:
> mm/dd/yyyy date format plus the time-of-day
do shell script "date '+%m/%d/%y@%I:%M:%S %p' "
-- Gnarlie
Chris Tangora Daytona Beach News-Journal 386.681.2748 chris.tangora <at> news-jrnl <dot> com
|