gpt4 book ai didi

android - 需要在计时器上获取其他值

转载 作者:行者123 更新时间:2023-11-30 03:14:18 24 4
gpt4 key购买 nike

<分区>

我有代码:

TextView txtCurrentTime = (TextView)findViewById(R.id.textClock);
Date dt = new Date();
int hours = dt.getHours();
int minutes = dt.getMinutes();
int seconds = dt.getSeconds();
String curTime = (hours + 4) + ":" + minutes + ":" + seconds;
txtCurrentTime.setText(curTime);

在输出中我得到:

1:2:1

但我需要得到:

01:02:01

我怎样才能得到这个值?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com