Creates a new Timestamp from the individual time components. The
individual time components are expected to be in UTC,
with the local offset from UTC (i.e.
offset)
already
applied to the time components.
As such, if the given
offset is non-null or zero, the resulting
Timestamp will have time values that
DO NOT match the time
parameters. A default
GregorianCalendar will be used to
perform any arithmetic operations on the resulting Timestamp. This
method also has a behavior of precision "narrowing", detailed in the
sub-section below.
For example, the following method calls will return Timestamps with
values (in its local time) respectively:
createFromUtcFields(Precision.FRACTION, 2012, 2, 3, 4, 5, 6, 0.007, null) will return 2012-02-03T04:05:06.007-00:00 (match)
createFromUtcFields(Precision.FRACTION, 2012, 2, 3, 4, 5, 6, 0.007, 0) will return 2012-02-03T04:05:06.007+00:00 (match)
createFromUtcFields(Precision.FRACTION, 2012, 2, 3, 4, 5, 6, 0.007, 480) will return 2012-02-03T12:05:06.007+08:00 (do not match)
createFromUtcFields(Precision.FRACTION, 2012, 2, 3, 4, 5, 6, 0.007, -480) will return 2012-02-02T20:05:06.007-08:00 (do not match)
createFromUtcFields(Precision.FRACTION, 2012, 2, 3, 4, 5, 6, 0.007, 720) will return 2012-02-03T16:05:06.007+12:00 (do not match)
createFromUtcFields(Precision.FRACTION, 2012, 2, 3, 4, 5, 6, 0.007, -720) will return 2012-02-02T16:05:06.007-12:00 (do not match)
Note: All of these resulting Timestamps have the similar value (in UTC) 2012-02-03T04:05:06.007Z.
Precision "Narrowing"
Any time component that is more precise
than the precision parameter
p will be excluded from the
calculation of the resulting Timestamp's point in time.
For example, the following method calls will return Timestamps with
values respectively:
createFromUtcFields(Precision.YEAR , 2012, 2, 3, 4, 5, 6, 0.007, 0) will return 2012T
createFromUtcFields(Precision.MONTH , 2012, 2, 3, 4, 5, 6, 0.007, 0) will return 2012-02T
createFromUtcFields(Precision.DAY , 2012, 2, 3, 4, 5, 6, 0.007, 0) will return 2012-02-03T
createFromUtcFields(Precision.MINUTE , 2012, 2, 3, 4, 5, 6, 0.007, 0) will return 2012-02-03T04:05Z
createFromUtcFields(Precision.SECOND , 2012, 2, 3, 4, 5, 6, 0.007, 0) will return 2012-02-03T04:05:06Z
createFromUtcFields(Precision.FRACTION, 2012, 2, 3, 4, 5, 6, 0.007, 0) will return 2012-02-03T04:05:06.007Z