1. Check out our app, Forums for Android! Download and leave feedback here!

Date formatted text on bitmap?

Discussion in 'Application Development' started by Grendizer, Mar 16, 2010.

  1. Grendizer

    Grendizer Member
    Thread Starter
    15

    Mar 14, 2010
    10
    0
    15
    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
    16

    Aug 10, 2008
    23
    7
    16
    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...