On Feb 12, 2015, at 15:00, Alex Satrapa <gr...@goldweb.com.au> wrote:
> 
> I got stuck trying to get the time of day into a useful format.
______________________________________________________________________

Hey Alex,

-------------------------------------------------------------------------------------------
# Nigel Garvey's ultra-fast date/time stamp handler.
-------------------------------------------------------------------------------------------
on dateTimeStamp()
        tell (current date) to return (((its year) * 10000 + (its month) * 100 
+ (its day)) as text) & "." & text 2 thru -1 of ((1000000 + (its hours) * 10000 
+ (its minutes) * 100 + (its seconds)) as text)
end dateTimeStamp

dateTimeStamp()

--> "20150212.161608"
-------------------------------------------------------------------------------------------

Here's what I often do when I want to be able to read the date/time stamp at a 
glance:

set newFilename to "My File Name { " & (do shell script "date '+%Y.%m.%d · 
%H.%M.%S'") & " }"

--> "My File Name { 2015.02.12 · 16.28.06 }"

-------------------------------------------------------------------------------------------

Nigel's runs in ~ 1/1000 sec.

The shell script based one in ~ 2/100 sec.

Unless I'm saving a number of files at once I find that year, month, day, 
hours, minutes, seconds provides plenty of granularity.

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.

Reply via email to