# Referencing the current month

**URL:** <https://forums.losant.com/t/referencing-the-current-month/4990>\
**Category:** Help\
**Tags:** workflow\
**Created:** [March 22, 2023, 11:38am UTC](https://forums.losant.com/t/referencing-the-current-month/4990 "2023-03-22T11:38:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cesar\_Guedes](https://avatars.discourse-cdn.com/v4/letter/c/e68b1a/32.png) [@Cesar\_Guedes](https://forums.losant.com/u/Cesar_Guedes)\
**Post date:** [March 22, 2023, 11:38am UTC](https://forums.losant.com/t/referencing-the-current-month/4990/1 "2023-03-22T11:38:00Z")

</div>

Hello!

I have an application that constantly has to use the first second of the current month and I have a feeling that i’m doing it in a very unsophisticated way:  
Every month I manually overwrite a device tag containing a source date, in the standard format, ready to be used in a date/time node.

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/203a567c934a041129a80bcb625a15da8931753b.png)

- Is it possible to update a tag periodically and automatically? I know that you can do it manually through the input controls block, but that is not what I need;
- Is there a way to reference a specific time of the current month? For example, triggering a workflow every 11PM of the last day of the current month.

Any insight would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [March 22, 2023, 1:21pm UTC](https://forums.losant.com/t/referencing-the-current-month/4990/2 "2023-03-22T13:21:55Z")

</div>

The answer to both of your questions is the [Timer Trigger’s Advanced mode](https://docs.losant.com/workflows/triggers/timer/#advanced), where you can provide a cron string to fire the workflow on a very specific schedule.

There are several [cron string generator](https://www.freeformatter.com/cron-expression-generator-quartz.html) websites out there that can help you build the configuration for the trigger.

I am curious about your use case, though, and your storing of this information on a device tag. It’s a static value that is easy to calculate at runtime; if you can tell me a little more about _why_ you are storing this value on your device metadata, I might be able to offer a simpler alternative.

---

<div class="post-metadata">

**Author:** ![Cesar\_Guedes](https://avatars.discourse-cdn.com/v4/letter/c/e68b1a/32.png) [@Cesar\_Guedes](https://forums.losant.com/u/Cesar_Guedes)\
**Post date:** [March 22, 2023, 1:41pm UTC](https://forums.losant.com/t/referencing-the-current-month/4990/3 "2023-03-22T13:41:38Z")

</div>

Hey, Dylan. I suspected the advanced timer would help me, thanks for the answer.

About this section of my application: I have to show, with precision, some data starting at 00:00:01 of the first day of the month until now.

In summary, here’s what this part of my workflow does:

- A **Date/time node** converts the present time to miliseconds;
- Another **Date/time node** converts the _Device Tag_ time (2023, march 1st, 00:00:01) to miliseconds;
- A **Math node** calculates this difference;
- **Data: Gauge Query node** uses this difference as the _Range Duration_ and the current time as the _Range End_. Using _Aggregation:Sum_, I have the number I want, from the beginning of march until the last value.

It’s easy, but, as I mentioned, it feels kinda brute/inefficient.
