# system.date.getMonth()?

**URL:** <https://forum.inductiveautomation.com/t/system-date-getmonth/70243>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 23, 2023, 8:19pm UTC](https://forum.inductiveautomation.com/t/system-date-getmonth/70243 "2023-02-23T20:19:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan\_Cannon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alan_cannon/32/31171_2.png) [@Alan\_Cannon](https://forum.inductiveautomation.com/u/Alan_Cannon)\
**Post date:** [February 23, 2023, 8:19pm UTC](https://forum.inductiveautomation.com/t/system-date-getmonth/70243/1 "2023-02-23T20:19:55Z")

</div>

Extracts the month from a date, where January is month 0.  
Why is January "0"?

print "datetime from system.date.now "+ str(system.date.now()) = datetime from system.date.now Thu Feb 23 14:27:09 EST 2023  
print "Month from system.date.now " +str(system.date.getMonth(system.date.now())) = Month from system.date.now 1  
print "datetime from import.now "+str(datetime.now()) = datetime from import.now 2023-02-23 19:27:09.169000  
print "Month from import.now " +str(datetime.month()) = Month from import.now \<property object at 0x2\>

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 23, 2023, 8:21pm UTC](https://forum.inductiveautomation.com/t/system-date-getmonth/70243/2 "2023-02-23T20:21:18Z")

</div>

Legacy from Java:  
[https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Calendar.html#MONTH](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Calendar.html#MONTH)

---

<div class="post-metadata">

**Author:** ![Alan\_Cannon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alan_cannon/32/31171_2.png) [@Alan\_Cannon](https://forum.inductiveautomation.com/u/Alan_Cannon)\
**Post date:** [February 23, 2023, 8:42pm UTC](https://forum.inductiveautomation.com/t/system-date-getmonth/70243/3 "2023-02-23T20:42:22Z")

</div>

"UNDECIMBER" that is too funny.

Anywho, i will just add to 1 to all my use cases of getMonth().
