04-20-2017 04:02 PM - edited 03-14-2019 05:14 PM
I've seen some scripts where D[now] is used to get the current date. Is this considered best practice?
I'm wondering if it's better to use java.util.Date() instead, or if there is a better recommendation.
04-21-2017 06:11 AM
I've never had issues with using either but one thing I have experienced is if you need a very specific format output the D[now] step isn't as flexible. It was a while ago that I dealt with that though so things may have changed or I may have just missed something.
How are you using the time variable?
04-21-2017 11:06 PM
Just to get the day of week and take action based on the day ie
switch int (D[now].dow)
04-24-2017 05:30 AM
I can't see where that would create any issues for you.
I think you could also easily use the "Day of Week" step under the general folder in the editor though. Might add some readability for the next guy.
Should be fine either way though.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide