seymoujd Posted September 2, 2015 Share Posted September 2, 2015 Can i write a rule that makes the date on a product automatically update to the current date each time it is composed? Quote Link to comment Share on other sites More sharing options...
David Miller Posted September 2, 2015 Share Posted September 2, 2015 (edited) Can i write a rule that makes the date on a product automatically update to the current date each time it is composed? I think so. var d = new Date(); return d; Edited September 2, 2015 by David Miller Quote Link to comment Share on other sites More sharing options...
step Posted September 2, 2015 Share Posted September 2, 2015 If you only want the date, you can format it like so: return FormatDate(new Date(), 'lm d, yyyy'); The Date object by default will return the day, date, and time. Quote Link to comment Share on other sites More sharing options...
David Miller Posted September 2, 2015 Share Posted September 2, 2015 (edited) If you only want the date, you can format it like so: return FormatDate(new Date(), 'lm d, yyyy'); The Date object by default will return the day, date, and time. Perfect! But if composing more than one time a day, having the time would be helpful. LOL. JK. He asked: ...each time it is composed? Welcome back step! Edited September 2, 2015 by David Miller Quote Link to comment Share on other sites More sharing options...
FreightTrain Posted September 2, 2015 Share Posted September 2, 2015 if you want it to return the current date use the following return FormatDate(Today(), 'lm d, yyyy'); Quote Link to comment Share on other sites More sharing options...
step Posted September 2, 2015 Share Posted September 2, 2015 Perfect! But it won't work if it is composed more than one time a day. LOL. JK. Does the current date change after each composition? I may have just time traveled. I assumed seymoujd was wanting to put the date somewhere on his composed file. So if he composed today and had to re-compose later today he'd still want it to say "September 2, 2015." I suppose if he wanted a unique date per each composition (in the case of file name for example) your unformatted approach is probably the better option. Quote Link to comment Share on other sites More sharing options...
David Miller Posted September 2, 2015 Share Posted September 2, 2015 (edited) Does the current date change after each composition? I may have just time traveled. I assumed seymoujd was wanting to put the date somewhere on his composed file. So if he composed today and had to re-compose later today he'd still want it to say "September 2, 2015." I suppose if he wanted a unique date per each composition (in the case of file name for example) your unformatted approach is probably the better option. I'm sure we both work in a very demanding production environment. We often compose jobs and send them into production several times a day. Everything is due now. On demand. Rush. Rush. Rush. Too many changes; blah, blah, blah. (Funny, there is always time to print it a second time when there is a problem.) I KNOW you understand what I mean. My approach WAS totally unformatted. Point being, just use a little Google-Fu. Date, time, here you go. Date formatting could be an entire topic altogether. Time travel is another story. But, I'd subscribe to that thread Step! Just let me know. I'm there. Edited September 3, 2015 by David Miller Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.