| Unix Content | Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| I posted this over in a windows server group and it was recommended that I pop over here. Does anyone have any ideas? It appears to be profile based to me as I see in my logs two uses logging into the same Terminal Server with the two values. I just need to try and figure out the best way (albeit manual if need be) to get all the dates the same. Thanks. .......Original Post here..... I have what I thought would be a simple project that is stumping me at the moment. I was asked to create a simple login/out file to log when a user signs in and out of a machine. I set up the script shown here: echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ \mopssrv01\MISData\MOPS-LOGONS.csv Simple one line bat file that I put in as a Login Script through GP. I have another one for Logout with just the word change at the end to tell me what they were doing. This is the output that I get in my CSV. Note the first and last one has the MON as part of the date. I have looked around and must be totally blind as I dont' see where I can change the actual format of the date to get two different values for %date%. Any ideas/thoughts? WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login WKSTN0014 USER2 08/25/2008 9:05:19.57 Login WKSTN0033 USER3 08/25/2008 9:05:21.96 Login WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut Not that it would really matter, but I did change the names from the real users! TIA. Tim |
|
#2
|
| TimParker > This is the output that I get in my CSV. Note the first and last one > has the MON as part of the date. I have looked around and must be > totally blind as I dont' see where I can change the actual format of > the date to get two different values for %date%. Any ideas/thoughts? You can't that directly. Getting a (unique) date is one of the most frequent questions in the group. A unique format can be ascertained, but not trivially. For more information see e.g. 1} How to get today's date elements into environment variables? http://www.netikka.net/tsneti/info/tscmd001.htm 165} How do I get the date and time separators and the local formats? http://www.netikka.net/tsneti/info/tscmd165.htm > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login Quite probably resolving the complications are not worth one's while, but it can be done. Especially if VBS is acceptable. All the best, Timo -- Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5 Department of Accounting and Business Finance ; University of Vaasa mailto:ts@uwasa.fi Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm |
|
#3
|
| "TimParker" news:e65305b3-4286-4af2-b486-c0b7feae4dd9@f63g2000hsf.googlegroups.com... >I posted this over in a windows server group and it was recommended > that I pop over here. Does anyone have any ideas? It appears to be > profile based to me as I see in my logs two uses logging into the same > Terminal Server with the two values. I just need to try and figure out > the best way (albeit manual if need be) to get all the dates the same. > Thanks. > > > ......Original Post here..... > I have what I thought would be a simple project that is stumping me > at > the moment. I was asked to create a simple login/out file to log when > a user signs in and out of a machine. I set up the script shown here: > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > \mopssrv01\MISData\MOPS-LOGONS.csv > > > Simple one line bat file that I put in as a Login Script through GP. > I > have another one for Logout with just the word change at the end to > tell me what they were doing. > > > This is the output that I get in my CSV. Note the first and last one > has the MON as part of the date. I have looked around and must be > totally blind as I dont' see where I can change the actual format of > the date to get two different values for %date%. Any ideas/thoughts? > > > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > > > Not that it would really matter, but I did change the names from the > real users! > > > TIA. > Tim > Timo's articles certainly show HOW to overcome the problem. The blindness however isn't on your part - there is no switch available to produce DATE (or TIME, for that matter) in a universal format. The format generated is that set as the 'short-format' by the USER, and may change on a user-by-user basis - hence to provide a universal format, each possible individual variation of element-presence, element-sequence, separator and 12/24-hour format structure needs to be addressed. |
|
#4
|
| On Aug 27, 4:26*am, TimParker > I posted this over in a windows server group and it was recommended > that I pop over here. Does anyone have any ideas? It appears to be > profile based to me as I see in my logs two uses logging into the same > Terminal Server with the two values. I just need to try and figure out > the best way (albeit manual if need be) to get all the dates the same. > Thanks. > > ......Original Post here..... > I have what I thought would be a simple project that is stumping me > at > the moment. I was asked to create a simple login/out file to log when > a user signs in and out of a machine. I set up the script shown here: > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > \mopssrv01\MISData\MOPS-LOGONS.csv > > Simple one line bat file that I put in as a Login Script through GP. > I > have another one for Logout with just the word change at the end to > tell me what they were doing. > > This is the output that I get in my CSV. Note the first and last one > has the MON as part of the date. I have looked around and must be > totally blind as I dont' see where I can change the actual format of > the date to get two different values for %date%. Any ideas/thoughts? > > WKSTN0027 USER1 Mon 08/25/2008 *9:04:02.45 Login > WKSTN0014 USER2 08/25/2008 *9:05:19.57 Login > WKSTN0033 USER3 08/25/2008 *9:05:21.96 Login > WKSTN0021 USER4 Mon 08/25/2008 *9:07:03.16 LogOut > > Not that it would really matter, but I did change the names from the > real users! > > TIA. > Tim the best way to manipulate dates/time is using other languages, like vbscript or others. |
|
#5
|
| "TimParker" news:e65305b3-4286-4af2-b486-c0b7feae4dd9@f63g2000hsf.googlegroups.com... [...] > I set up the script shown here: > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > \mopssrv01\MISData\MOPS-LOGONS.csv > > [...] > > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > In that case i have had an idea. How about echo %date:~-10% instead the simple %date% for Your special problem? That will output the last 10 chars of the %date%. The Day will be cut off. Greetings Carsten |
|
#6
|
| "Carsten Beckermann" news:g945sh$ivm$00$1@news.t-online.com... > > "TimParker" > news:e65305b3-4286-4af2-b486-c0b7feae4dd9@f63g2000hsf.googlegroups.com... > > [...] > >> I set up the script shown here: >> >> echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ >> \mopssrv01\MISData\MOPS-LOGONS.csv >> >> > [...] >> >> WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login >> WKSTN0014 USER2 08/25/2008 9:05:19.57 Login >> WKSTN0033 USER3 08/25/2008 9:05:21.96 Login >> WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut >> > > > In that case i have had an idea. > How about echo %date:~-10% instead the simple %date% for Your special > problem? > That will output the last 10 chars of the %date%. > The Day will be cut off. > > Greetings > Carsten > Suppose another user has selected a two-digit-year date format? Regardless, you may get users who prefer dd/mm/yy formats - which can get really confusing at times. I once worked at a company where their mainframe system used dd/mm/yy format but their microcomputer network was locked to mm/dd/yy. The confusion caused by people mis-reading dates or failing to convert the appropriate number of times cost millions - all for the sake of two minutes' work which the people who had the microcomputer contract refused to do. |
|
#7
|
| billious wrote: > "Carsten Beckermann" > news:g945sh$ivm$00$1@news.t-online.com... > > > > "TimParker" > > news:e65305b3-4286-4af2-b486-c0b7feae4dd9@f63g2000hsf.googlegroups.com... > > > > [...] > > > >> I set up the script shown here: > >> > >> echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > >> \mopssrv01\MISData\MOPS-LOGONS.csv > >> > >> > > [...] > >> > >> WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > >> WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > >> WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > >> WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > >> > > > > > > In that case i have had an idea. > > How about echo %date:~-10% instead the simple %date% for Your special > > problem? > > That will output the last 10 chars of the %date%. > > The Day will be cut off. > > > > Greetings > > Carsten > > > > Suppose another user has selected a two-digit-year date format? The following would be useful for that situation. http://tinyurl.com/5z245c > > Regardless, you may get users who prefer dd/mm/yy formats - which can get > really confusing at times. I once worked at a company where their mainframe > system used dd/mm/yy format but their microcomputer network was locked to > mm/dd/yy. The confusion caused by people mis-reading dates or failing to > convert the appropriate number of times cost millions - all for the sake of > two minutes' work which the people who had the microcomputer contract > refused to do. Your past employer should have told them who was working for who and put a stop payment on the contract until the issue was resolved to their satisfaction. OTOH, hind sight is 20/20. -- Todd Vargo (Post questions to group only. Remove "z" to email personal messages) |
|
#8
|
| > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOu The second string is win2K date format. Set new date var to solve problem. For example: set udate=%date:~-10% And use %udate%. |
|
#9
|
| "Todd Vargo" news:H1otk.20547$89.14472@nlpi069.nbdc.sbc.com... > billious wrote: >> "Carsten Beckermann" >> news:g945sh$ivm$00$1@news.t-online.com... >> > >> > "TimParker" >> > > news:e65305b3-4286-4af2-b486-c0b7feae4dd9@f63g2000hsf.googlegroups.com... >> > >> > [...] >> > >> >> I set up the script shown here: >> >> >> >> echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ >> >> \mopssrv01\MISData\MOPS-LOGONS.csv >> >> >> >> >> > [...] >> >> >> >> WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login >> >> WKSTN0014 USER2 08/25/2008 9:05:19.57 Login >> >> WKSTN0033 USER3 08/25/2008 9:05:21.96 Login >> >> WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut >> >> >> > >> > >> > In that case i have had an idea. >> > How about echo %date:~-10% instead the simple %date% for Your special >> > problem? >> > That will output the last 10 chars of the %date%. >> > The Day will be cut off. >> > >> > Greetings >> > Carsten >> > >> >> Suppose another user has selected a two-digit-year date format? > > The following would be useful for that situation. > http://tinyurl.com/5z245c > >> >> Regardless, you may get users who prefer dd/mm/yy formats - which can get >> really confusing at times. I once worked at a company where their > mainframe >> system used dd/mm/yy format but their microcomputer network was locked to >> mm/dd/yy. The confusion caused by people mis-reading dates or failing to >> convert the appropriate number of times cost millions - all for the sake > of >> two minutes' work which the people who had the microcomputer contract >> refused to do. > > Your past employer should have told them who was working for who and put a > stop payment on the contract until the issue was resolved to their > satisfaction. OTOH, hind sight is 20/20. > > -- > Todd Vargo > (Post questions to group only. Remove "z" to email personal messages) > Touching innocence! You are presuming that the decisions are made in the interests of the business concerned, and appear not to have considered that the decision may have been made for other reasons - like for instance the personal bank balances of those actually making the decisions, for instance... ![]() |