title: Informix 7.3 - Declaring a date column data type with default as current date on insert/update
body: <p>Looking for your help again <a href="https://stackoverflow.com/users/15168/jonathan-leffler">Jonathan Leffler</a>!</p>
  
  <p>I am creating a table on Informix 7.3 and need a timestamp field that will default to <code>today</code> on inserts and updates.  </p>
  
  <p>How can I define a date/datetime/timestamp column for a table with a default value of the current time?</p>
  
  <p>Here is a field definition for a simple date field:</p>
  
  <pre><code>column upd_date date
      comments ""
      desc "Last update date"
      heading "Last update date"
      text "Last update date"
      attributes
   (
   )
  </code></pre>
  
  <p>There is also some other syntax in schema files that have comments about what the default <i>should</i> be:</p>
  
  <pre><code>column beg_date date{DEF: date academic session/subsession officially begins}
  
      comments ""
      desc "Beginning date."
      heading "Beg Date"
      text "Date - Begin"
      attributes
   (
   )
  </code></pre>
  
  <p>I'm not sure of any other tables that have this functionality, and I'm not even 100% sure that it is supported, but if there is a way, I'd love to know.</p>
  
  <p>The only good lead I've found on the topic is <a href="http://www.tek-tips.com/viewthread.cfm?qid=95520&amp;page=65" rel="nofollow noreferrer">here</a></p>
  
  <p>Anyone have any ideas/solutions?</p>
  
  <p><hr>
  <b>More findings:</b><br>
  <a href="http://www.4js.com/techdocs/genero/fgl/devel/DocRoot/User/DatabaseSchema.html" rel="nofollow noreferrer">http://www.4js.com/techdocs/genero/fgl/devel/DocRoot/User/DatabaseSchema.html</a><br>
  <a href="https://stackoverflow.com/questions/1555977/cast-date-in-informix/1556381#1556381">Cast Date in Informix</a></p>
  
  <p>There is a <code>datetime</code> column type that I found in another table def:</p>
  
  <pre><code>column beg_time datetime year to minute
      comments    ""
      desc    "Beginning date and time of period"
      heading "Beg Time"
      text    "Date/Time - Slot Begin"
      attributes
      (
      )
  {DEF: date and time this group/person may register}
  </code></pre>