1 package com.daffodilwoods.daffodildb.server.sessionsystem; 2 import com.daffodilwoods.database.resource.*; 3 import java.io.Serializable ; 4 import java.sql.*; 5 6 public class DateTimeFunctions implements Serializable 7 { 8 Timestamp timeStamp; 9 10 13 14 public DateTimeFunctions() { 15 timeStamp = new Timestamp(System.currentTimeMillis()); 16 } 17 18 21 22 public void setCurrentTime() throws DException { 23 timeStamp.setTime(System.currentTimeMillis()); 24 } 25 26 29 30 public Date getDate() throws DException { 31 return new com.daffodilwoods.daffodildb.utils.DBDate(timeStamp.getTime()); 32 } 33 34 37 38 public int getMonth() throws DException { 39 return timeStamp.getMonth(); 40 } 41 42 45 46 public int getYear() throws DException { 47 return timeStamp.getYear(); 48 } 49 50 53 54 public int getHour() throws DException { 55 return timeStamp.getHours(); 56 } 57 58 61 62 public int getMinutes() throws DException { 63 return timeStamp.getMinutes(); 64 } 65 66 69 70 public int getSeconds() throws DException { 71 return timeStamp.getSeconds(); 72 } 73 public Time getTime() throws DException { 74 return new Time(timeStamp.getTime()); 75 } 76 public java.sql.Timestamp getTimeStamp( ) throws DException { 77 return timeStamp; 78 } 79 public void resetTransactionDate(){ 80 timeStamp = new Timestamp(System.currentTimeMillis()); 81 } 82 83 } 84 | Popular Tags |