Some time handled functions

xiaoxiao2021-03-06  21

// Decompiled by DJ V3.6.6.79 Copyright 2004 Atanas Neshkov Date: 2005-3-22 9: 18: 19 // Home Page: http://members.fortunecity.com/neshkov/dj.html - Check Offen for New Version! // Decompiler Options: Packimports (3) // Source File Name: DateutuTil.JAVA

Package com.broadvision.commerce.marketmaker.util;

Import com.broadvision.components.jsobject.bvi_datetime; import com.broadvision.util.bvlog;

Public class dateutil {

Public Dateutil () {}

public static String dateParseToString (BVI_DateTime datetime) throws Exception {String temp = datetime.getYear () "-"; if (datetime.getMonth () <10) temp = temp "0" datetime.getMonth (); else temp = Temp DateTime.getMonth (); if (DateTime.getDay () <10) Temp = Temp "-0" DateTime.getDay (); Else Temp = Temp " DateTime.getDay (); if (DateTime.Gethour () <10) Temp = Temp "0" DateTime.Gethour (); else temp = temp "" DateTime.Gethour (); if (DateTime.getminute () <10) Temp = Temp ": 0" DateTime.getminute (); Else Temp = Temp ": DateTime.getMinute (); if (DateTime.getSecond () <10) Temp = Temp ": 0 " DateTime.getSecond ); Else Temp = Temp ":" DateTime.getSecond (); return temp;}

public static String dateParseToStringNoTime (BVI_DateTime datetime) throws Exception {if (datetime == null) {return "";} else {String temp = datetime.getYear () "/" datetime.getMonth () "/" datetime .getday (); Return Temp;}}}

public static String getDistanceOfTwoTime (BVI_DateTime time1, BVI_DateTime time2) {String Temp = ""; try {long time1L = time1.getUlongValue (); long time2L = time2.getUlongValue (); long distance = time1L - time2L; BVLog.error ( " Time1 ---- " Time1L); bvlog.error (" Time2 ---- " Time2L); long second = distance% 60L; bvlog.error (" SECOND --- " Second); bvlog.ERROR "distance =======" distance); distance / = 60L; long minute = distance% 60L; bvlog.error ("distance =======" distance); distance / = 60L; long Hour = distance% 24; bvlog.error ("distance =======" distance); distance / = 24; long day = distance; bvlog.error ("distance =======" distance ); If (day> 0L) Temp = day "/ u5929" HOUR "/ u5c0f / u65f6" minute "/ u5206 / u949f" second "/ u79d2"; Else if (Hour> 0L) Temp = Hour "/ U5C0F / U65F6" Minute "/ U5206 / U949F" Second "/ U79D2"; ELSE IF (Minute> 0L) TEMP = Minute "/ U5206 / U949F " Second " / U79D2 "; Else IF (Second> 0L) TEMP = Second " / U79D2 ";

} Catch (Exception e) {} return Temp;} public static BVI_DateTime stringParseToDate (String datetime) throws Exception {if (datetime == null) {return null;} else {BVLog.error ( "in date utility ----" DateTime); bvlog.error ("DT ----------------------- Year" DateTime.Substring (0, 4)); BVLOG ("DT ----------------------" DateTime.Substring (5, 7)); bvlog.error ("DT -------------------------- day " datetime.substring (8, 10)); bvlog.error (" DT ----- -------------------- Hour " DateTime.Substring (11, 13)); bvlog.error (" DT ---------- ---------------- Minute " DateTime.Substring (14, 16)); int year = integer.parseint (datetime.substring (0, 4)); int MONTH = Integer .PARSEINT (DateTime.Substring (5, 7)); int day = integer.parseint (DateTime.Substring (8, 10)); int hour = integer.parseint (DateTime.Substring (11, 13)) INT minute = integer.Parseint (DateTime.Substring (14, 16)); return new bvi_datetime (Year, Month, day, hour, minute, 0, null);}}}

转载请注明原文地址:https://www.9cbs.com/read-44369.html

New Post(0)