# Could not invoke method: BusEvent.postUpdate(java.lang.String,java.lang.String) on instance: null

**URL:** <https://community.openhab.org/t/could-not-invoke-method-busevent-postupdate-java-lang-string-java-lang-string-on-instance-null/96520>\
**Category:** Scripts & Rules\
**Created:** [April 13, 2020, 2:30pm UTC](https://community.openhab.org/t/could-not-invoke-method-busevent-postupdate-java-lang-string-java-lang-string-on-instance-null/96520 "2020-04-13T14:30:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [April 13, 2020, 3:56pm UTC](https://community.openhab.org/t/could-not-invoke-method-busevent-postupdate-java-lang-string-java-lang-string-on-instance-null/96520/2 "2020-04-13T15:56:45Z")

</div>

> [@Tallboy](#):
>
> postUpdate(historyName, new DateTimeType())

When using postUpdate in that way, it requires two strings.  
`new DateTimeType()`  
unsuprisingly gives you a DateTimeType object, not a string.  
Maybe  
`new DateTimeType().toString`  
although I really don’t know if that gives a format that a DateTime Item can digest.  
This might help -

> [@DateTime Conversion (openHAB 2.x)](https://community.openhab.org/t/datetime-conversion/54266):
>
> Because openHAB 3.x rules now use Java Time API instead of Jodatime, there is a [new DateTime Conversion thread for openHAB 3.x](https://community.openhab.org/t/datetime-conversion-openhab-3-x/107197). Overview In openHab 2.x there are different ways to handle Date/Time values. DateTimeType A [DateTime Item](https://www.openhab.org/docs/concepts/items.html#items) carries a [DateTimeType](https://www.openhab.org/docs/concepts/items.html#state-and-command-type-formatting). Joda DateTime By default openHAB 2.x-Rules use a [Joda DateTime class](http://joda-time.sourceforge.net/apidocs/org/joda/time/DateTime.html) to represent time, most notably now. Epoch The lowest common denominator when working with time is to get at the epoc value. Epoc is the number of milliseconds …

---

_[View the full topic](https://community.openhab.org/t/could-not-invoke-method-busevent-postupdate-java-lang-string-java-lang-string-on-instance-null/96520)._
