Top Description Constructors Methods
com.ziclix.python.sql

public Class JavaDateFactory

extends Object
implements DateFactory
Class Inheritance
All Implemented Interfaces
com.ziclix.python.sql.DateFactory
Imports
org.python.core.Py, .PyObject, java.sql.Time, .Timestamp, java.util.Calendar

Produce java.[util|sql] type dates.
Author
brian zimmer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PyObject

Returns:

date as PyObject
Date
(int
to set
year
,
int
to set
month
,
int
to set
day
)

Implements com.ziclix.python.sql.DateFactory.Date.

This function constructs an object holding a date value.

public PyObject

Returns:

PyObject
DateFromTicks
(long
number of seconds since the epoch
ticks
)

Implements com.ziclix.python.sql.DateFactory.DateFromTicks.

This function constructs an object holding a date value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

public PyObject

Returns:

time as PyObject
Time
(int
to set
hour
,
int
to set
minute
,
int
to set
second
)

Implements com.ziclix.python.sql.DateFactory.Time.

This function constructs an object holding a time value.

public PyObject

Returns:

PyObject
TimeFromTicks
(long
number of seconds since the epoch
ticks
)

Implements com.ziclix.python.sql.DateFactory.TimeFromTicks.

This function constructs an object holding a time value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

public PyObject

Returns:

time stamp as PyObject
Timestamp
(int
to set
year
,
int
to set
month
,
int
to set
day
,
int
to set
hour
,
int
to set
minute
,
int
to set
second
)

Implements com.ziclix.python.sql.DateFactory.Timestamp.

This function constructs an object holding a time stamp value.

public PyObject

Returns:

PyObject
TimestampFromTicks
(long
number of seconds since the epoch
ticks
)

Implements com.ziclix.python.sql.DateFactory.TimestampFromTicks.

This function constructs an object holding a time stamp value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JavaDateFactoryback to summary
public JavaDateFactory()

Method Detail

Dateback to summary
public PyObject Date(int year, int month, int day)

Implements com.ziclix.python.sql.DateFactory.Date.

This function constructs an object holding a date value.

Parameters
year:int

to set

month:int

to set

day:int

to set

Returns:PyObject

date as PyObject

Annotations
@Override

DateFromTicksback to summary
public PyObject DateFromTicks(long ticks)

Implements com.ziclix.python.sql.DateFactory.DateFromTicks.

This function constructs an object holding a date value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

Note

The DB API 2.0 spec calls for time in seconds since the epoch while the Java Date object returns time in milliseconds since the epoch. This module adheres to the python API and will therefore use time in seconds rather than milliseconds, so adjust any Java code accordingly.

Parameters
ticks:long

number of seconds since the epoch

Returns:PyObject

PyObject

Annotations
@Override

Timeback to summary
public PyObject Time(int hour, int minute, int second)

Implements com.ziclix.python.sql.DateFactory.Time.

This function constructs an object holding a time value.

Parameters
hour:int

to set

minute:int

to set

second:int

to set

Returns:PyObject

time as PyObject

Annotations
@Override

TimeFromTicksback to summary
public PyObject TimeFromTicks(long ticks)

Implements com.ziclix.python.sql.DateFactory.TimeFromTicks.

This function constructs an object holding a time value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

Note

The DB API 2.0 spec calls for time in seconds since the epoch while the Java Date object returns time in milliseconds since the epoch. This module adheres to the python API and will therefore use time in seconds rather than milliseconds, so adjust any Java code accordingly.

Parameters
ticks:long

number of seconds since the epoch

Returns:PyObject

PyObject

Annotations
@Override

Timestampback to summary
public PyObject Timestamp(int year, int month, int day, int hour, int minute, int second)

Implements com.ziclix.python.sql.DateFactory.Timestamp.

This function constructs an object holding a time stamp value.

Parameters
year:int

to set

month:int

to set

day:int

to set

hour:int

to set

minute:int

to set

second:int

to set

Returns:PyObject

time stamp as PyObject

Annotations
@Override

TimestampFromTicksback to summary
public PyObject TimestampFromTicks(long ticks)

Implements com.ziclix.python.sql.DateFactory.TimestampFromTicks.

This function constructs an object holding a time stamp value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

Note

The DB API 2.0 spec calls for time in seconds since the epoch while the Java Date object returns time in milliseconds since the epoch. This module adheres to the python API and will therefore use time in seconds rather than milliseconds, so adjust any Java code accordingly.

Parameters
ticks:long

number of seconds since the epoch

Returns:PyObject

PyObject

Annotations
@Override