[ncl-talk] Help on time units qualifiers

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Thu Nov 15 21:11:24 MST 2018


Mateus,

Those units qualifiers are from the original UDUNITS package which set the
precedent for formatted date/time unit strings.  UDUNITS originally called
them "origin shift operators".

The four words all mean exactly the same thing in this context.  They are
the human-readable separator between the base unit, e.g. "days", and the
string representing the timeline origin, e.g. "0001-01-01".

--Dave


On Thu, Nov 15, 2018 at 7:11 PM Mateus da Silva Teixeira <
mateusstex at gmail.com> wrote:

> Hi,
>
> Some time ago I asked about an issue noted when using units qualifiers. I
> would like to know if someone take a look on it.
>
> Thanks,
>
> Mateus
>
>
> Em 21 de ago de 2018, à(s) 09:48, Mateus da Silva Teixeira <
> mateusstex at gmail.com> escreveu:
>
> Hi,
>
> I'm testing date functions and noted that the usage of different units
> qualifiers: "since", "after", "from" and "ref" has no impact on results
> from cd_inv_calendar_function(). See my example below:
>
>
>
>
>
>
>
>
> *dataTeste = cd_inv_calendar( 2018, 08, 21, 09, 30, 0, "days since
> 0001-01-01 00:00:00", 0 )print( dataTeste+"  <=== since" )dataTeste =
> cd_inv_calendar( 2018, 08, 21, 09, 30, 0, "days after 0001-01-01 00:00:00",
> 0 )print( dataTeste+"  <=== after" )dataTeste = cd_inv_calendar( 2018, 08,
> 21, 09, 30, 0, "days from 0001-01-01 00:00:00", 0 )print( dataTeste+"  <===
> from" )dataTeste = cd_inv_calendar( 2018, 08, 21, 09, 30, 0, "days ref
> 0001-01-01 00:00:00", 0 )print( dataTeste+"  <=== ref" )*
>
> and the output:
>
> (0)    736928.3958333334  <=== since
> (0)    736928.3958333334  <=== after
> (0)    736928.3958333334  <=== from
> (0)    736928.3958333334  <=== ref
>
> Is it correct?
>
> If yes, what the purpose of these units qualifiers?
>
> Thank you!
>
> Mateus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181115/c83c135d/attachment.html>


More information about the ncl-talk mailing list