|
|
|||||||
Hi! Trying to rename a file with the acctual date and time. Want it to look like this: "backup 2010-08-12.bkf" Code: Move "H:\Backup\backup.bkf" "H:\Backup\backup @date.bkf" @date dosent seem to work, what have I done wrong? /Nicklas |
||||||||
|
|
|||||||
Try it like this: Code: Move Move "H:\Backup\backup.bkf" "H:\Backup\backup "+@date+".bkf" |
||||||||
|
|
|||||||
Thx for the tip, unfortunatly it dosnīt work. I guess you made a typo when you wrote "Move Move". Only shows a error on that row. Writing this does not work either. Code: Move "H:\Backup\backup.bkf" "H:\Backup\backup "+@date+".bkf" If I remove the "+" todays date shows up on the screen, but it dosenīt save it to the file. Am I using the wrong command? Code: Move "H:\Backup\backup.bkf" "H:\Backup\backup "@date".bkf" OS: Windows 2003 Kix Ver: 4.61.0.0 |
||||||||
|
|
|||||||
You have to replace the "/"s with "-"s try with Kix 4.61 Code: Move "H:\Backup\backup.bkf" "H:\Backup\backup " + replace(@date,"/","-") + ".bkf" older kix Code: Move "H:\Backup\backup.bkf" "H:\Backup\backup " + join(split(@date,"/"),"-") + ".bkf" |
||||||||
|
|
|||||||
It worked! thx alot! |
||||||||
|
|
|||||||
@time and @date have invalid characters for file and folder names. In the date slashes and in the time remove the colon. Both are not allowed in file and folder names. You can also replace them with something else like Allen suggested. |
||||||||
|
|
|||||||
Actually not. @TIME and @DATE are based on your regional setttings. If they contains slash separators then @TIME and @DATE will use those. |
||||||||
|
|
|||||||
Yep. Sorry missed that one. |
||||||||
|
|
|||||||
Originally Posted By: apronk Actually not. @TIME and @DATE are based on your regional setttings. If they contains slash separators then @TIME and @DATE will use those. Is that right? I don't have a system to check on, but the KiXtart manual states that the format for @DATE is "YYYY/MM/DD" and @TIME is "HH:MM:SS" and I understood that was the case, i.e. regional settings are ignored and the information is returned in a fixed format. |
||||||||
|
|
|||||||
I have a system to check it on and yes, date always uses the weird, screwed up way of representing date. at least it's not bad as US version that puts day in the middle. |
||||||||
|
|
|||||||
"Screwed up way" as it is in the manual or ...? |
||||||||
|
|
|||||||
screwed up = not the way I like it |
||||||||
|
|
|||||||
lol... okay... so do you not like yyyy/mm/dd? |
||||||||
|
|
|||||||
not as much as dd.mm.yyyy it is easier to do [censored] with the kix way, but who actually uses that format irl? |
||||||||
|
|
|||||||
lol. I got CENSORED! |
||||||||
|
|
|||||||
hehe you only like dd.mm.yyyy because that is what you're used to seeing in your Country. The yyyy.mm.dd actually sorts properly as it belongs even without the automated sorting of XP/Vista/Win7 |
||||||||
|
|
|||||||
yes, it sorts nicely. but kixtart uses yyyy/mm/dd you can't use such formatting with files in wintosh machines. |
||||||||
|
|
|||||||
Us ancient coders always use YYYYMMDD for dates (with or without seperators), it saves all the sort coding and problems with date confusion. (Actually the *really* ancient coders used YYMMDD because it saved on data storage and finger wear on card punchers, but they learned their lesson in 2000 and as punishment had their leather arm patches ceremoniously removed and were made to have a hair-cut) As a case in point, one of our SSL certificates expired on me on the 10th August and caused some minor havoc. Our documentation from the supplier clearly stated that the certificate was good until 8th October. Wait a minute.... 10/08/2010 expired, 08/10/2010 should have expired. Doh! The curse of US vs European date confusion strikes again! The problem with using DD/MM/YYYY or MM/DD/YYYY is that unless you have a reference point or the days > 12 there is no way to determine which format is being used. YYYY-MM-DD is well known and understood and reduces the opportunity for fubar. And don't get me started on people who insist on using a 12 hour clock. |
||||||||
|
|
|||||||
Originally Posted By: Richard H. And don't get me started on people who insist on using a 12 hour clock. Using 1pm rather than 13:00 ?! All the same, easy as pie :p |
||||||||
|
|
|||||||
What!? There's only 12 hours? No wonder I can't get everything done in one day! I actually use the Join(Split(@DATE, '/'), '') fairly often to add dates to my log files.. putting the date first, then "_logname.log" makes it very clear what time period the log entries represent. Glenn |
||||||||
|
|
|||||||
Hah! and noon is? I've lost track of the number of times I've caught people out with 12:00 - is that AM or PM? Noon or Midnight. Worse are the ones who send maintenance notices out for 08:00 and then crib afterwards that "Of course it meant 08:00 in the evening, we thought that was obvious so we didn't bother with the PM" And people who send mails with times of (say) 13:00 GMT when what they actually mean is 13:00 local time in the UK (which is currently 12:00 GMT as we are in summer time). Is it hot in here? Nurse! |
||||||||
|
|
|||||||
lol... get his meds now.. |
||||||||
|
|
|||||||
What? Maintenance at 8 PM?? Can't nearly inconvenience enough people at that hour! Of course it's 08:00 (as in AM)! OK, Richard - how about those people who write 24:00 for midnight?? I actually found a script once that tried to trigger something at 24:00 instead of 23:59 or 00:00. "Time" as we refer to it is a measurment of its passing - at midnight of the current day, no (reasonably measurable) time has passed, so it is 00:00. If you don't think time is important, consider the $$$$$$$$$ spend in 1999. I had a moment this morning when I found that the time on my cell phone was off by 4 minutes.. It is supposed to sync with the carrier's time base - does this mean that time at one of the largest telecoms in the US has bad time sync? Glenn PS - stick to the good meds! |
||||||||
|
|
|||||||
so, 12AM is midnight or noon? |
||||||||
|
|
|||||||
From Wikipedia 12 hour clock The National Maritime Museum, Greenwich, states: To avoid confusion, the correct designation for twelve o'clock is 12 noon or 12 midnight. Alternatively, the twenty-four-hour-clock system may be used. The abbreviation a.m. stands for ante-meridiem (before the Sun has crossed the line) and p.m. for post-meridiem (after the Sun has crossed the line). At 12 noon the Sun is at its highest point in the sky and directly over the meridian. It is therefore neither "ante-" nor "post-".[9] Maybe this is also part of the reason. The US just doesn't want to change things. Quote: According to the CIA Factbook only Burma (Myanmar), Liberia, and the United States have yet to adopt the International System of Units as their official system of measurement.[ |
||||||||
|
|
|||||||
I once spotted a leap-second (belatedly - I'm not sad enough to sit in front of an atomic clock on New Year's Eve). One of my Linux servers had been running for a couple of years and I happened to need to get onto the console, and there it was - notification that a leap second event had occurred and the time was 23:59:60 I am however sad enough to have taken a screen shot |
||||||||
|
|
|||||||
well, that didn't remove any confusion at all. to avoid confusion, everyone should abandon their wrist watches and learn the fact that there are 24 hours in a day. |
||||||||
|
|
|||||||
If everyone used something like this then everything would be ok. 9 minutes past eight aka 8:09pm aka 20:09 on the watch below if Im reading it correctly. http://www.h-spot.net/watches_british.htm |
||||||||
|
|
|||||||
lol. and richard, that truly is odd. 23:59:60? |
||||||||
|
|
|||||||
Leap-seconds, eh? Well, that's cool in a geeky/nerdy kind of way.. Glenn |
||||||||
|
|
|||||||
I found leap seconds briefly interesting, but of course on the Internerd you can always find someone who's fascination for a subject appears to be uncomfortably intense: http://www.leapsecond.com/ |
||||||||
|
|
|||||||
well... he seems to love HP. thought he had time lab, not an hp storage. |