WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: JTaylor on February 26, 2023, 09:11:38 PM

Title: Omnibus Extender - Dates
Post by: JTaylor on February 26, 2023, 09:11:38 PM
I have added a new Function named snTimeMap().  This is a Beta version of the function and I would love some feedback.

It allows you to submit a date string and a template for how it should be interpreted and turn it into a usable date.   It breaks out the various parts/info in a Map.  Requires WinBatch 2021B and higher, I think.  Some predefined templates are provided.

See Help file for more info.   I would love to hear back.  I think there are some tweaks I need to make regarding assumptions about local vs GM time but wouldn't mind hearing from someone who knows what they are talking about.  Also, happy to add more items to Map or more predefined templates.

http://www.jtdata.com/anonymous/wbomnibus.zip

Thanks.


Jim
Title: Re: Omnibus Extender - Dates
Post by: stanl on February 27, 2023, 02:42:03 AM
Here is a lookup that might be helpful [tab delimited]
Title: Re: Omnibus Extender - Dates
Post by: JTaylor on February 27, 2023, 05:47:21 AM
Other than the Unix Epoch template, it currently returns the time as it is submitted, which is probably the way to go but wondered what others thought.  Leaving one to use the TimeZone functions to adjust, if needed.   Maybe I should switch Unix Epoch to assume local time and one could use the TimeZone functions to make any needed adjustments to it as well???  Although, I am thinking that Unix Epoch, by definition is GM time by definition....or am I thinking wrong?

Thanks.

Jim
Title: Re: Omnibus Extender - Dates
Post by: JTaylor on February 27, 2023, 12:58:03 PM
I realized I was getting distracted from the purpose of this function.  It isn't to do any type of conversion related to timezones but to simply take a date string, even non-standard ones, and turn them into a usable date.  The point is to return the same date, as presented, but in a usable form. 

Jim
Title: Re: Omnibus Extender - Dates
Post by: stanl on February 27, 2023, 01:07:17 PM
Quote from: JTaylor on February 27, 2023, 12:58:03 PM
The point is to return the same date, as presented, but in a usable form. 

Jim


doesn't format() or ToString() do that?
Title: Re: Omnibus Extender - Dates
Post by: JTaylor on February 27, 2023, 01:14:20 PM
Are those WinBatch functions?  Doesn't sound familiar in that context.   If speaking of TimeFormat() that assumes you have a Winbatch formatted date.

Jim
Title: Re: Omnibus Extender - Dates
Post by: JTaylor on February 27, 2023, 03:52:46 PM
After some more research and getting back on track...this should resolve some issues.


http://www.jtdata.com/anonymous/wbomnibus.zip


Jim
Title: Re: Omnibus Extender - Dates
Post by: JTaylor on February 28, 2023, 06:59:13 AM
Also, just to clarify, in the event my earlier posts weren't clear, the point of this function isn't to format dates.  WinBatch already does that.   This is for processing data and avoiding the need to manipulate/reformat strings to get a date into a usable form.   It provides a flexible way to obtain a valid date you can use for whatever purpose you need.

Jim