[Modify]修改免费礼物逻辑

This commit is contained in:
wushaocheng
2022-12-15 11:35:13 +08:00
parent 7a852cf35d
commit 5a185b07e6
10 changed files with 41 additions and 16 deletions

View File

@@ -380,11 +380,11 @@ public class TimeUtils {
return builder.toString();
}
public static String timeConversion(int time) {
int hour = 0;
int minutes = 0;
int sencond = 0;
int temp = time % 3600;
public static String timeConversion(long time) {
long hour = 0;
long minutes = 0;
long sencond = 0;
long temp = time % 3600;
if (time > 3600) {
hour = time / 3600;
if (temp != 0) {
@@ -406,6 +406,19 @@ public class TimeUtils {
return (hour<10?("0"+hour):hour) + ":" + (minutes<10?("0"+minutes):minutes) + ":" + (sencond<10?("0"+sencond):sencond);
}
public static String secondsToTime(long seconds){
long h=seconds/3600; //小时
long m=(seconds%3600)/60; //分钟
long s=(seconds%3600)%60; //秒
if(h>0){
return h+"小時"+m+"分鐘"+s+"";
}
if(m>0){
return m+"分鐘"+s+"";
}
return s+"";
}
public static String getChineseMonth(Context context, long millis) {
int month = getMonth(millis);
String[] monthStrs = context.getResources().getStringArray(R.array.time_month_strs);