# Date format problem

**URL:** <https://forum.servoy.com/t/date-format-problem/5108>\
**Category:** Classic Servoy\
**Created:** [November 24, 2005, 10:05am UTC](https://forum.servoy.com/t/date-format-problem/5108 "2005-11-24T10:05:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [November 24, 2005, 10:05am UTC](https://forum.servoy.com/t/date-format-problem/5108/1 "2005-11-24T10:05:05Z")

</div>

Hello,

I have a table view with several fields, all non editable. One of them is a date, formatted as “dd.MM.yyyy HH:mm”. If I click on the field once and then click somewhere else, I get this in the log:

> Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: Cannot format given Object as a Date  
> at java.text.DateFormat.format(Unknown Source)  
> at java.text.Format.format(Unknown Source)  
> at javax.swing.text.InternationalFormatter.valueToString(Unknown Source)  
> at com.servoy.j2db.dataui.DataField$d.valueToString(Unknown Source)  
> at javax.swing.JFormattedTextField$AbstractFormatter.install(Unknown Source)  
> at javax.swing.text.DefaultFormatter.install(Unknown Source)  
> at javax.swing.text.InternationalFormatter.install(Unknown Source)  
> at com.servoy.j2db.dataui.DataField$d.install(Unknown Source)  
> at javax.swing.JFormattedTextField.setFormatter(Unknown Source)  
> at com.servoy.j2db.dataui.DataField.setFormatter(Unknown Source)  
> at javax.swing.JFormattedTextField.setValue(Unknown Source)  
> at javax.swing.JFormattedTextField.processFocusEvent(Unknown Source)  
> at com.servoy.j2db.dataui.DataField.processFocusEvent(Unknown Source)  
> at java.awt.Component.processEvent(Unknown Source)  
> at java.awt.Container.processEvent(Unknown Source)  
> at java.awt.Component.dispatchEventImpl(Unknown Source)  
> at java.awt.Container.dispatchEventImpl(Unknown Source)  
> at java.awt.Component.dispatchEvent(Unknown Source)  
> at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)  
> at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)  
> at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)  
> at java.awt.Component.dispatchEventImpl(Unknown Source)  
> at java.awt.Container.dispatchEventImpl(Unknown Source)  
> at java.awt.Component.dispatchEvent(Unknown Source)  
> at java.awt.EventQueue.dispatchEvent(Unknown Source)  
> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)  
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)  
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
> at java.awt.EventDispatchThread.run(Unknown Source)

Servoy Developer  
Version R2 2.2.2-build 334  
Java version 1.5.0\_05-b05 (Windows XP)
