MCPcopy Create free account
hub / github.com/L-JINBIN/ApkDataMultiplexing / javaToDosTime

Method javaToDosTime

src/bin/zip/ZipUtil.java:25–35  ·  view source on GitHub ↗
(long time)

Source from the content-addressed store, hash-verified

23 }
24
25 public static long javaToDosTime(long time) {
26 Calendar cal = Calendar.getInstance();
27 cal.setTimeInMillis(time);
28 int year = cal.get(Calendar.YEAR);
29 if (year < 1980) {
30 return (1 << 21) | (1 << 16);
31 }
32 return (year - 1980L) << 25 | (cal.get(Calendar.MONTH) + 1) << 21 |
33 cal.get(Calendar.DATE) << 16 | cal.get(Calendar.HOUR_OF_DAY) << 11 | cal.get(Calendar.MINUTE) << 5 |
34 cal.get(Calendar.SECOND) >> 1;
35 }
36
37 public static void writeByte(byte[] array, int pos, int value) throws IOException {
38 if (pos + 1 > array.length) {

Callers 1

CenterFileHeaderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected