1 17 package org.alfresco.filesys.smb; 18 19 import java.util.Date ; 20 21 26 public class NTTime 27 { 28 30 public static final long InfiniteTime = 0x7FFFFFFFFFFFFFFFL; 31 32 35 private static final long TIME_CONVERSION = 116444736000000000L; 36 37 43 public final static long toNTTime(Date jdate) 44 { 45 46 49 long ntDate = (jdate.getTime() * 10000L) + TIME_CONVERSION; 50 return ntDate; 51 } 52 53 59 public final static long toNTTime(long jdate) 60 { 61 62 65 long ntDate = (jdate * 10000L) + TIME_CONVERSION; 66 return ntDate; 67 } 68 69 75 public final static SMBDate toSMBDate(long ntDate) 76 { 77 78 80 long jDate = (ntDate - TIME_CONVERSION) / 10000L; 81 return new SMBDate(jDate); 82 } 83 84 90 public final static long toJavaDate(long ntDate) 91 { 92 93 95 long jDate = (ntDate - TIME_CONVERSION) / 10000L; 96 return jDate; 97 } 98 } 99 | Popular Tags |