Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-19-2009, 04:40 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Date time format issue

I am moving all the builds to a new box,I have set regional and language options to English US .Short date format is :M/d/yyyy
and date separator is /.I have done this for my user and for the user used to launch scheduled tasks also.
However when the buils scheduled task is started-the date time in log appear in a different format:
//**************
18.3.2009 20:01:07: Building project step 'SET TIME_START Macro'...
Updated Project macro 'TIME_START'
18.3.2009 20:01:07: Building project step 'Log the start time'...
TIME_START is 18.3.2009 20:01:07
//**************
I set TIME_START (with a set Macro step) to %DATETIME%.
I do not understand why it appears in this format.
Later I set TIME_END also to %DATETIME%:
//***************
18.3.2009 20:13:21: Building project step 'SET TIME_END Macro'...
Updated Project macro 'TIME_END'
18.3.2009 20:13:21: Building project step 'Log the end time'...
TIME_END is 18.3.2009 20:13:21
//***************
and then the build fails when setting the time interval:
//***************
18.3.2009 20:13:21: Building project step 'set the time interval between TIME_START and TIME_END'...
Error in Run Script (VBScript) script code at Line 6, Column 1 (Type mismatch: '[string: "18.3.2009 20:13:21"]')
18.3.2009 20:13:21: Step 'set the time interval between TIME_START and TIME_END' failed
//***************
The VBScript code for this step is:
//**********
Set ts = vbld_AllMacros()("TIME_START")
Set te = vbld_AllMacros()("TIME_END")
Set ti = vbld_AllMacros()("TIME_INTERVAL")
Set svnd = vbld_AllMacros()("SVN_DURATION")

ti.Value=DateDiff("s",ts.Value,te.Value)
svnd.Value=ti.Value
Builder.LogMessage "Elapsed time for step (seconds) = " &ti.Value
//************
Any idea how to fix this error?
Normally the dates should appear like :
3/18/2009 8:01:07 PM and 3/18/2009 8:13:21 PM and this way I will not have any error when calculating the time interval.
When I open the VBP project and try to run manually these steps -everything is set correctly.Only when running from sch task I have this error.
Reply With Quote
  #2  
Old 03-19-2009, 12:35 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
I suspect that the Windows system locale or the user locale for the user the task is running under needs to be configured to use the desired date format. You would need to contact Microsoft regarding that. You can exclude VBP from the equation by scheduling a .bat file containing:
date /t >c:\test.log
Reply With Quote
  #3  
Old 03-20-2009, 04:29 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
I did some research-it seems during the install of OS -regional options were set to Czech Republic.Although I set this differently later for the related users-system still used this Cz settings when launching sch task.
However -I found some workaround -I have set Language and Regional options to ‘English US’-> and then Ticked the checkbox in Advanced ‘Apply all settings to the current user accoount and to the default user profile’.After I did this -the correct date format was used when launching Sch task for VBP project.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 02:17 AM.


Copyright © 1999-2023 Kinook Software, Inc.