Hi,

I was wishing to seek some advice on how I can accomplish a task I came into. I have a MySQL database that has a "last updated" column and I have it set to TIMESTAMP so that MySQL automatically updates the field when database has been updated.

However, I also have a cron job that runs a perl script I made that updates the same exact database with the "last updated" column. Therefore, everytime the cron job runs daily, then the last updated column will also be automatically updated. The problem is that I want the last updated value to be the last date the database has been edited phsyically by a data operator. The database btw stores Notes that requires a last udpated field to show the last edit.

So to resolve this, I may just have Perl automatically keep track of the updated date. Instead of having MySQL automatically do it, I will insert a code that generates a data value so I can manually store it in the edit function of my script.

I want a date value to me in the following type of format:

Tue Jan 3 2004

I have already spent the last 2 hours trying to figure this out, but still having trouble. Any help will greatly be appreciated.

Thanks for taking your time to read this,

Alexa

In reply to Perl to create Date modified value by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.