帮助以时间格式显示整数值 - 新手 [英] help to show integer value in a time format - newbie

查看:58
本文介绍了帮助以时间格式显示整数值 - 新手的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有


i状态从 int 值显示为时间格式

是否有可能使用现有的java util类?或者我需要参加我自己的课程?

请帮助我获得一个懒惰,

dear all

i am n a situation to display from a int value into Time format,
is there any possiblity of using existing java util classes? or i need to rite my own class?
kindly help me to get a sloution ,

推荐答案


亲爱的所有


i am na情况从 int 值显示为时间格式

是否有使用现有java util类的可能性?或者我需要参加我自己的课程?

请帮助我获得奖金,
dear all

i am n a situation to display from a int value into Time format,
is there any possiblity of using existing java util classes? or i need to rite my own class?
kindly help me to get a sloution ,



你能否更清楚地描述你的问题。 br />
如果给出以下程序,输出应该是什么

  • 2
  • -1
  • 0
  • 1945
  • 1999876
  • Integer.MAX_VALUE


  • 你能否更清楚地描述你的问题。

    如果程序得到以下结果,那么输出应该是什么
    • 2
    • -1
    • 0
    • 1945
    • 1999876
    • Integer.MAX_VALUE



    答案:


    上面列表中的有效输入是 - > 1945年& o / p将是这样的7.45 pm





    整数值大小为4,(我是作为时间存储在表格中

    例如


    如果表格中的时间是1500>>

    那么我必须show,类似这种格式 3.00 pm 在屏幕上



    答案:


    上面列表中的有效输入是 - > 1945年& o / p将是这样的7.45 pm





    整数值大小为4,(我是作为时间存储在表格中

    例如


    如果表格中的时间是1500>>

    那么我必须show,类似这种格式 3.00 pm 在屏幕上
    Ans:

    the valid input in the above list is --> 1945 & the o/p will be like this 7.45 pm


    hi ,

    the integer value size is 4, ( which i stored in table as Time)
    for example

    if time is 1500 in table >>
    then i have to show , something like this format 3.00 pm in screen



    现在你不觉得这是对问题的更好描述?

    您可以编写自己的方法或使用GregorianCalendar类。

    最好分步进行。

    首先确定输入是否有效与否(必须是正数且必须包含4位数字)。

    然后将数字分成几小时和几分钟。然后你可以将它们设置为gc来获取am或pm,或者使用if else自己手动完成。

    Well now don''t you think that is a better description of the problem now?
    You can write your own method or use the GregorianCalendar class.
    Better do this in steps.
    First determine whether the input is valid or not (must be positive and must contain 4 digits).
    Then split the digits by half into hours and minutes. You can then either set those into a gc to get the am or pm or use a if else to do it yourself manually.


    这篇关于帮助以时间格式显示整数值 - 新手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆