- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 12:40 AM
Hi,
The Run as tz is not working in scheduled export sets.
I'm running a scheduled export set at 8.00 AM IST. But the file generated has SNXXX20201006231000 rather than SNXXX20201007080000
The run as tz is configured to IST. But still the name of the file generated appends the date time as US/Pacific
Is there a way to append the date time to the scheduled export set file with user timezone or based on the current date time its generated?
Regds,
Shanker
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 09:34 PM
Hi,
I removed the Append timestamp from the export set.
I got this addressed by having a script to get the current date time and update to the Export set file name in the scheduled export set.
Regds,
Shanker

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 02:14 AM
Hi
please ensure about the following note:
If that user has no timezone value associated to his account (in that user's User record) the system will use the default system timezone as configured in the System Property glide.sys.default.tz
If I have answered your question, please mark my response as correct and helpful so that this thread can be closed and others can be benefited by this.
Thank you very much
Cheers
Alberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2020 06:23 AM
Did this solve your question? Or do we need to follow-up on this?
If I have answered your question, please mark my response as correct and helpful so that others with the same question in the future can find it quickly and that it gets removed from the unanswered list.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 02:14 AM
Hi Shanker,
I had similar issue previously but don't remember what was the outcome.
Are you executing it manually and what is your timezone?
Please raise a HI ticket and let us know an update
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 09:34 PM
Hi,
I removed the Append timestamp from the export set.
I got this addressed by having a script to get the current date time and update to the Export set file name in the scheduled export set.
Regds,
Shanker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2021 12:58 AM
Hi Shankar,
Could you please guide me with the script you have written, because I have written the below script inside the Scheduled Export but it did not work. Its always returning me the Export set File name -
var currentdate = new GlideDate();
var DateTime = currentdate.getByFormat("yyyyMMddHHmmss");
var date = currentdate.getByFormat("yyyyMMdd");
var time =currentdate.getByFormat("HHmmss");
var dateTime = date+"_"+time;
var jprobe = new JavascriptProbe(gs.getProperty("csm.Astro.midserver.name"));
jprobe.setName("SFTP File Transfer of Astro Batch File"); //any name can be given.
jprobe.setJavascript("var req = new SFTP();req.FileTransfer();");
jprobe.addParameter("ftpserver",gs.getProperty('Astro.sftp.server'));
jprobe.addParameter("ftpserverport",gs.getProperty('csm.astro.sftp.server.port'));
jprobe.addParameter("ftpserverusername",gs.getProperty('csm.astro.sftp.username'));
var Encrypter = new GlideEncrypter();
var decrypted = Encrypter.decrypt(gs.getProperty('csm.astro.sftp.password'));
var automation_api = new sn_automation.AutomationAPI();
var password = gs.getProperty('csm.astro.sftp.password');
jprobe.addParameter("ftpserverpassword",decrypted);
jprobe.addParameter("targetPath",gs.getProperty('csm.astro.sftp.path'));
var a = export_set.file_name.split('.');
var fileName = a[0] + "_" +dateTime + "." + a[1];
jprobe.addParameter("fileName", fileName); //export_set.file_name);
var targetFileName = a[0] + "_" +dateTime + "." + a[1];
jprobe.addParameter("targetFileName", targetFileName);