-
-
Save AdamDimech/66391d775d0d602a207b4dfc41e8556e to your computer and use it in GitHub Desktop.
Prints a time string in ImageJ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro "Time Stamp" { | |
MonthNames = newArray("01","02","03","04","05","06","07","08","09","10","11","12"); | |
getDateAndTime(year, month, dayOfWeek, dayOfMonth, hour, minute, second, msec); | |
TimeString =""; | |
if (dayOfMonth<10) {TimeString = TimeString+"0";} | |
TimeString = ""+year+""+MonthNames[month]+""+dayOfMonth+""+TimeString; | |
if (hour<10) {TimeString = TimeString+"0";} | |
TimeString = TimeString+hour+""; | |
if (minute<10) {TimeString = TimeString+"0";} | |
TimeString = TimeString+minute+""; | |
if (second<10) {TimeString = TimeString+"0";} | |
TimeString = TimeString+second; | |
print("The generated time string is", TimeString); // Prints the time stamp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment