calendar event

Discussion in 'Ruby' started by Sushrut Sathe, Apr 9, 2009.

  1. In my application i use such table(table as follows) in which the
    Date_time field by default takes (2001-07-21 11:31:00 UTC)such time
    format but i want only date, then how i remove the created_time &
    updated_time.
    Also how to change the format of date i want dd/mm/yyyy


    -------------------------------------------------------------------------
    creation_id Modification_id Delete Date_time

    X Data N 2001-07-21 11:31:00 UTC
    -------------------------------------------------------------------------
    --
    Posted via http://www.ruby-forum.com/.
     
    Sushrut Sathe, Apr 9, 2009
    #1
    1. Advertising

  2. On 09.04.2009 15:39, Sushrut Sathe wrote:
    > In my application i use such table(table as follows) in which the
    > Date_time field by default takes (2001-07-21 11:31:00 UTC)such time
    > format but i want only date, then how i remove the created_time &
    > updated_time.


    Then you should use class Date.

    require 'date'
    puts Date.today

    > Also how to change the format of date i want dd/mm/yyyy


    You should make the distinction between internal and external
    representation: internally you use a data type that properly abstracts
    "dates". For output you transform this into a suitable format.

    irb(main):008:0> Date.today.strftime "%d/%m/%Y"
    => "09/04/2009"

    If you internally need also time then you can use class DateTime and
    apply the same formatting:

    irb(main):010:0> DateTime.now.strftime "%d/%m/%Y"
    => "09/04/2009"

    HTH

    Kind regards

    robert
     
    Robert Klemme, Apr 9, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DAR

    how to make event calendar.

    DAR, Apr 8, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    436
  2. Bruce W..1

    How to call Calendar DayRender event?

    Bruce W..1, Dec 9, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    8,762
    Bruce W..1
    Dec 9, 2003
  3. Shevek
    Replies:
    3
    Views:
    6,059
    Shevek
    Jun 23, 2004
  4. Shevek
    Replies:
    0
    Views:
    398
    Shevek
    Jun 23, 2004
  5. Parthiv Joshi
    Replies:
    1
    Views:
    731
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page