Date formatted text on bitmap?


Last Updated:

  1. Grendizer

    Grendizer Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    10
    Likes Received:
    0
    Hey all,

    I'm wondering how to format a date to that it will be shown as following:
    January 23 Saturday.

    I want it to be displayed on a bitmap. I've been able to draw up the bitmap, which looks like this:
    http://img692.imageshack.us/img692/9821/kalenderblad.png

    So I'd want to place January on the red part and 23 and saturday on the striped part.
    I dont think I have a problem with placing the text but i'd appreciate help with the date formatting.
     

    Advertisement
  2. jon21569

    jon21569 Member

    Joined:
    Aug 10, 2008
    Messages:
    23
    Likes Received:
    7
    import java.text.SimpleDateFormat;
    import java.util.Date;

    final Date date = new Date( System.currentTimeMillis() );
    final SimpleDateFormat formatterMonth = new SimpleDateFormat( "MMMM" );
    final SimpleDateFormat formatterDateDay = new SimpleDateFormat( "d EEEE" );
    final String monthText = formatterMonth.format(date);
    final String dateDayText = formatterDateDay.format(date);
    System.out.println( monthText );
    System.out.println( dateDayText );
     
    Grendizer likes this.

Share This Page

Loading...