Omnibus Extender - Dates

Started by JTaylor, February 26, 2023, 09:11:38 PM

Previous topic - Next topic

JTaylor

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

stanl

Here is a lookup that might be helpful [tab delimited]

JTaylor

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

JTaylor

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

stanl

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?

JTaylor

Are those WinBatch functions?  Doesn't sound familiar in that context.   If speaking of TimeFormat() that assumes you have a Winbatch formatted date.

Jim

JTaylor

After some more research and getting back on track...this should resolve some issues.


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


Jim

JTaylor

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