BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Stokes
Community Trekker

JSL: automatic pull today's date and build into the script questions

Hi, in my current JSL script, there is a phrase to define the start date of data pull, it is below,

 

START_DATE = "03Apr2019_19_19_34";

 

I hope to replace "01Mar2019_19_19_34" into "today's date".

Basically whenever open the JSL, I hope this "01Mar2019_19_19_34" will be automatically updated into the current date/time.

Also, I hope to still keep the same format of "01Mar2019_19_19_34".

Is there a way to do it?
Thanks

0 Kudos
5 REPLIES 5
uday_guntupalli
Community Trekker

Re: JSL: automatic pull today's date and build into the script questions

@Stokes , 
      Maybe something like this ? I am assuming that you want the script to always use the current date because you did not specify what that value needs to take. 

 

START_DATE = "03Apr2019_19_19_34";

CurrTime = As Date(Today()); 

CurrTimeChar = Char(CurrTime); 

Left = Words(CurrTimeChar,":"); 

Date = Left[1]; 

DesDate = Date || "_" || Char(Hour(CurrTime)) || "_" || Char(Minute(CurrTime)) || "_"|| Char(Second(CurrTime)); 

START_DATE = DesDate; 
Best
Uday
Stokes
Community Trekker

Re: JSL: automatic pull today's date and build into the script questions

Thanks for the help
0 Kudos

Re: JSL: automatic pull today's date and build into the script questions

Here is a more succinct solution:

 

START_DATE = Substitute( Format( Today(), "ddMonyyyy:h:m:s" ), ":", "_" );
Learn it once, use it forever!
vince_faller
Super User

Re: JSL: automatic pull today's date and build into the script questions

Can I ask why you want to do this?  Are you trying to make a start time in a gui update?

0 Kudos
Highlighted
Stokes
Community Trekker

Re: JSL: automatic pull today's date and build into the script questions

Thanks for all help, I use this function to automatically update the date in my script so I can get the updated data from "today"

0 Kudos