All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.DateTimeConverter

java.lang.Object
   |
   +----com.ibm.as400.access.DateTimeConverter

public class DateTimeConverter
extends Object
The DateTimeConverter class represents a converted date and time. The AS/400 System API QWCCVTDT is used to convert a date and time value from one format to another format.


Constructor Index

 o DateTimeConverter(AS400)
Constructs a DateTimeConverter object.

Method Index

 o convert(byte[], String)
Returns a converted Date object.
 o convert(byte[], String, String)
Converts date and time values from the input format to the requested output format.
 o convert(Date, String)
Returns the converted date and time in a byte array.

Constructors

 o DateTimeConverter
 public DateTimeConverter(AS400 system)
Constructs a DateTimeConverter object.

Parameters:
system - The AS/400 system.

Methods

 o convert
 public byte[] convert(byte data[],
                       String inFormat,
                       String outFormat) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
Converts date and time values from the input format to the requested output format.

Parameters:
system - The AS/400 system.
data - The date and time value to be converted.
inFormat - The input date and time format. Possible values are:
  • *CURRENT
  • *DTS
  • *JOB
  • *SYSVAL
  • *YMD
  • *YYMD
  • *MDY
  • *MDYY
  • *DMY
  • *DMYY
  • *JUL
  • *LONGJUL
outFormat - The output date and time format. Possible values are:
  • *DTS
  • *JOB
  • *SYSVAL
  • *YMD
  • *YYMD
  • *MDY
  • *MDYY
  • *DMY
  • *DMYY
  • *JUL
  • *LONGJUL
  • *DOS
Returns:
The converted date and time value.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o convert
 public Date convert(byte data[],
                     String inFormat) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
Returns a converted Date object.

Parameters:
data - The date and time value to be converted.
inFormat - The format of the date and time value being provided. Possible values are:
  • *CURRENT
  • *DTS
  • *JOB
  • *SYSVAL
  • *YMD
  • *YYMD
  • *MDY
  • *MDYY
  • *DMY
  • *DMYY
  • *JUL
  • *LONGJUL
Returns:
The converted date and time.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o convert
 public byte[] convert(Date date,
                       String outFormat) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
Returns the converted date and time in a byte array.

Parameters:
date - The Date object to be converted.
outFormat - The format of the returned date and time value. Possible values are:
  • *DTS
  • *JOB
  • *SYSVAL
  • *YMD
  • *YYMD
  • *MDY
  • *MDYY
  • *DMY
  • *DMYY
  • *JUL
  • *LONGJUL
Returns:
The converted date and time.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.

All Packages  Class Hierarchy  This Package  Previous  Next  Index