Logic Machine Forum
name csv-file with date in format yymmdd - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: name csv-file with date in format yymmdd (/showthread.php?tid=2519)



name csv-file with date in format yymmdd - Geert - 16.03.2020

Hi Daniel,

I've made new thread  Smile

Do you mean: filename = os.date("%f",d)'test.csv'


os.date("%F",d) this will give you date in such format 2020-03-06


PS. Please create new thread when you can't find relevant to your question.


RE: name csv-file with date in format yymmdd - admin - 17.03.2020

Use "%y%m%d" format.


RE: name csv-file with date in format yymmdd - Geert - 18.03.2020

Hi,

My csv-filename I have to send changes for different buildings. So I made the filename variable in the beginning of the script: 

8 Filename = os.date("%y%m%d")'2714_functietest.csv'

44 res, err = mailattach(ToServiceEmail, Subject, Message , Filename, csv, 'text/csv')

By executing the script I got error:
Resident_script: 8: attempt to call a string value
stack traceback

What am I doing wrong?


RE: name csv-file with date in format yymmdd - admin - 18.03.2020

Use .. to concatenate two strings:
Code:
Filename = os.date("%y%m%d") .. '2714_functietest.csv'



RE: name csv-file with date in format yymmdd - Geert - 18.03.2020

It's working Thx!