help to show integer value in a time format - newbie

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mumbaimacro
    New Member
    • Sep 2006
    • 25

    #16
    Originally posted by JosAH
    Ok, so a date/time value is stored as an int. So far so good; What exactly is
    stored in that int? The time of the day? Are seconds, milliseconds included?
    We need to specify exactly what is in that int and how time is encoded as an
    int value before we can start designing or even implementing fancy classes.

    Right now we haven't even touched the specification/requirement stage which
    has to be completed before we can even design something.

    kind regards,

    Jos
    Field Size
    Time 6


    In that case for eg : This value s stored from other program based on some conditions

    Value for this field is 194512 in table and display will be either of the one below , i am not sure which one s appropriate or easy to show from the below formats

    19:45:12 (hh:mm:ss)
    or
    07:45 pm

    kindly suggest me

    thnks

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #17
      Originally posted by mumbaimacro
      Field Size
      Time 6


      In that case for eg : This value s stored from other program based on some conditions

      Value for this field is 194512 in table and display will be either of the one below , i am not sure which one s appropriate or easy to show from the below formats

      19:45:12 (hh:mm:ss)
      or
      07:45 pm

      kindly suggest me

      thnks
      You mean the field size is 6 or less?
      I suggest you work on the allowable input first and how it maps to time. Displaying in 12 hour or 24 hour is easily done as the the last exercise.

      Comment

      • mumbaimacro
        New Member
        • Sep 2006
        • 25

        #18
        Originally posted by r035198x
        You mean the field size is 6 or less?
        I suggest you work on the allowable input first and how it maps to time. Displaying in 12 hour or 24 hour is easily done as the the last exercise.

        actually that time s stored by a cobol prgm , where its updating table with 6 digits

        TIME 9(006)

        but when i look in sybase table desciption its showing the following

        TIME int 4

        also all d data i am having for this field n sybase shows

        TIME 194512

        so confused to tell u the correct size sir!!!!!!!!!

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #19
          But if the decimal representation of the number is equal to, say, the display of
          a digital clock, all you have to do is something like this:

          [code=java]
          DecimalFormat df= new DecimalFormat(" 00,00,00");
          DecimalFormatSy mbols dfs= new DecimalFormatSy mbols();
          dfs.setGrouping Character(':');
          df.setDecimalFo matSymbols(dfs) ;
          ...
          // and format away using df and your int values
          [/code]

          kind regards,

          Jos

          ps. read the API documentation for those classes; most likely I made a few
          typos above; it was from the top of my head.

          Comment

          • mumbaimacro
            New Member
            • Sep 2006
            • 25

            #20
            Originally posted by JosAH
            But if the decimal representation of the number is equal to, say, the display of
            a digital clock, all you have to do is something like this:

            [code=java]
            DecimalFormat df= new DecimalFormat(" 00,00,00");
            DecimalFormatSy mbols dfs= new DecimalFormatSy mbols();
            dfs.setGrouping Character(':');
            df.setDecimalFo matSymbols(dfs) ;
            ...
            // and format away using df and your int values
            [/code]

            kind regards,

            Jos

            ps. read the API documentation for those classes; most likely I made a few
            typos above; it was from the top of my head.
            thnks for the suggestions sir, really it will be a grt help to me

            Best Regards...

            Comment

            Working...