Home | History | Annotate | Download | only in time

Lines Matching refs:sec

156 // sec returns the time's seconds since Jan 1 year 1.
157 func (t *Time) sec() int64 {
165 func (t *Time) unixSec() int64 { return t.sec() + internalToUnix }
170 sec := int64(t.wall << 1 >> (nsecShift + 1))
171 dsec := sec + d
197 t.ext = t.sec()
208 sec := int64(t.ext)
209 if sec < minWall || maxWall < sec {
212 t.wall |= hasMonotonic | uint64(sec-minWall)<<nsecShift
234 ts := t.sec()
235 us := u.sec()
244 return t.sec() < u.sec() || t.sec() == u.sec() && t.nsec() < u.nsec()
256 return t.sec() == u.sec() && t.nsec() == u.nsec()
341 // time would be represented by sec=-1, nsec=1e9. However, it does
361 // sec = t % 60
365 // sec = t % 60
366 // if sec < 0 {
367 // sec += 60
392 // used for Time's sec field?are called internal times.
432 return t.sec() == 0 && t.nsec() == 0
443 sec := t.unixSec()
445 if l.cacheZone != nil && l.cacheStart <= sec && sec < l.cacheEnd {
446 sec += int64(l.cacheZone.offset)
448 _, offset, _, _, _ := l.lookup(sec)
449 sec += int64(offset)
452 return uint64(sec + (unixToInternal + internalToAbsolute))
463 sec := t.unixSec()
465 if l.cacheZone != nil && l.cacheStart <= sec && sec < l.cacheEnd {
469 name, offset, _, _, _ = l.lookup(sec)
471 sec += int64(offset)
475 abs = uint64(sec + (unixToInternal + internalToAbsolute))
511 sec := (abs + uint64(Monday)*secondsPerDay) % secondsPerWeek
512 return Weekday(int(sec) / secondsPerDay)
575 func (t Time) Clock() (hour, min, sec int) {
580 func absClock(abs uint64) (hour, min, sec int) {
581 sec = int(abs % secondsPerDay)
582 hour = sec / secondsPerHour
583 sec -= hour * secondsPerHour
584 min = sec / secondsPerMinute
585 sec -= min * secondsPerMinute
779 sec := d / Second
781 return float64(sec) + float64(nsec)/1e9
885 d := Duration(t.sec()-u.sec())*Second + Duration(t.nsec()-u.nsec())
919 hour, min, sec := t.Clock()
920 return Date(year+years, month+Month(months), day+days, hour, min, sec, int(t.nsec()), t.Location())
1040 func now() (sec int64, nsec int32, mono int64)
1044 sec, nsec, mono := now()
1045 sec += unixToInternal - minWall
1046 if uint64(sec)>>33 != 0 {
1047 return Time{uint64(nsec), sec + minWall, Local}
1049 return Time{hasMonotonic | uint64(sec)<<nsecShift | uint64(nsec), mono, Local}
1052 func unixTime(sec int64, nsec int32) Time {
1053 return Time{uint64(nsec), sec + unixToInternal, Local}
1130 sec := t.sec()
1134 byte(sec >> 56), // bytes 1-8: seconds
1135 byte(sec >> 48),
1136 byte(sec >> 40),
1137 byte(sec >> 32),
1138 byte(sec >> 24),
1139 byte(sec >> 16),
1140 byte(sec >> 8),
1141 byte(sec),
1164 if len(buf) != /*version*/ 1+ /*sec*/ 8+ /*nsec*/ 4+ /*zone offset*/ 2 {
1169 sec := int64(buf[7]) | int64(buf[6])<<8 | int64(buf[5])<<16 | int64(buf[4])<<24 |
1180 t.ext = sec
1257 // sec seconds and nsec nanoseconds since January 1, 1970 UTC.
1259 // Not all sec values have a corresponding time value. One such
1261 func Unix(sec int64, nsec int64) Time {
1264 sec += n
1268 sec--
1271 return unixTime(sec, int32(nsec))
1299 // The month, day, hour, min, sec, and nsec values may be outside
1311 func Date(year int, month Month, day, hour, min, sec, nsec int, loc *Location) Time {
1321 // Normalize nsec, sec, min, hour, overflowing into day.
1322 sec, nsec = norm(sec, nsec, 1e9)
1323 min, sec = norm(min, sec, 60)
1361 abs += uint64(hour*secondsPerHour + min*secondsPerMinute + sec)
1427 sec := t.sec()
1428 if sec < 0 {
1431 sec = -sec
1435 sec-- // sec >= 1 before the -- so safe
1448 qmod2 = int(sec/d1) & 1
1449 r = Duration(sec%d1)*Second + Duration(nsec)
1457 sec := uint64(sec)
1458 tmp := (sec >> 32) * 1e9
1461 tmp = (sec & 0xFFFFFFFF) * 1e9