summaryrefslogtreecommitdiff
path: root/src/pkg/time/time.go
AgeCommit message (Collapse)AuthorFilesLines
2010-03-30time: do not segment time strings by character class.Russ Cox1-6/+6
instead use pure substring matching to find template values. this makes stdZulu unnecessary and allows formats like "20060102 030405" (used in some internet protocols). this makes Parse not handle years < 0000 or > 9999 anymore. that seems like an okay price to pay, trading hypothetical functionality for real functionality. also changed the comments on the Time struct to use the same reference date as the format and parse routines. R=r CC=golang-dev http://codereview.appspot.com/833045
2010-03-30single argument panicRuss Cox1-2/+2
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev http://codereview.appspot.com/850041
2010-01-07New time formatter, time.Format(formatString)Rob Pike1-152/+0
The model is that formatString is a a representation of a standard time, and that Format converts the time to that representation. Standard representaitons are defined for ANSIC, RFC850, RFC1123, and ISO8601. There's also a humane Kitchen fomat: 3:04PM. R=rsc, benolive, cw CC=golang-dev http://codereview.appspot.com/181130
2009-12-17time: add ISO 8601 time formatBen Olive1-1/+22
Fixes issue 431. R=r, rsc CC=golang-dev http://codereview.appspot.com/179079 Committer: Russ Cox <rsc@golang.org>
2009-12-151) Change default gofmt default settings forRobert Griesemer1-136/+136
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 5th and last set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180050
2009-12-02time: another bug in SecondsToUTC.Russ Cox1-0/+9
added random test to look for more. Fixes issue 363. R=r, cw http://codereview.appspot.com/163071
2009-12-01time: fix handling of Jan 1 1601, 1201, 801, ...Russ Cox1-6/+6
R=r CC=hurtonm http://codereview.appspot.com/164074
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer1-37/+37
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-13/+13
R=rsc, r http://go/go-review/1025029
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer1-18/+6
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-10-08more lgtm files from gofmtRuss Cox1-2/+2
R=gri OCL=35485 CL=35488
2009-10-07apply gofmt to rand reflect regexp rpc runtime sort strconv strings sync ↵Russ Cox1-75/+69
syscall testing time unicode unsafe utf8 R=gri DELTA=1409 (79 added, 24 deleted, 1306 changed) OCL=35415 CL=35437
2009-10-06Change description of time.Time.ZoneOffset to specify east is +ve.Adam Langley1-1/+1
Currently, the description says that +ve numbers are westwards of UTC. Typically, timezones are specified with +ve numbers running east of Greenwich. For example, San Francisco is specified as UTC-8. Also, when calling time.Localtime(), the following is returned on my box in PDT: {Year:2009 Month:10 Day:5 Hour:18 Minute:55 Second:6 Weekday:1 ZoneOffset:-25200 Zone:PDT} Note that the ZoneOffset is negative. This leads me to suspect that the description is mistaken. R=rsc APPROVED=rsc DELTA=1 (0 added, 0 deleted, 1 changed) OCL=35356 CL=35377
2009-09-15more "declared and not used".Russ Cox1-1/+1
the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638
2009-09-14do not crash printing the zero value for time.Time.Russ Cox1-1/+2
R=r DELTA=2 (1 added, 0 deleted, 1 changed) OCL=34605 CL=34608
2009-08-12convert low-level (used by testing) packages toRuss Cox1-1/+0
whole-package compilation. new Makefiles, tests now in separate package bytes flag fmt io math once os reflect strconv sync time utf8 delete import "xxx" in package xxx. inside package xxx, xxx is not declared anymore so s/xxx.//g delete file and package level forward declarations. note the new internal_test.go and sync and strconv to provide public access to internals during testing. the installed version of the package omits that file and thus does not open the internals to all clients. R=r OCL=33065 CL=33097
2009-08-10remove unnecessary pkg. referencesRuss Cox1-1/+1
R=r DELTA=95 (0 added, 0 deleted, 95 changed) OCL=33012 CL=33012
2009-06-25Change os.Error convention:Russ Cox1-4/+1
echo back context of call in error if likely to be useful. For example, if os.Open("/etc/passwd", os.O_RDONLY) fails with syscall.EPERM, it returns as the os.Error &PathError{ Op: "open", Path: "/etc/passwd" Error: os.EPERM } which formats as open /etc/passwd: permission denied Not converted: datafmt go/... google/... regexp tabwriter template R=r DELTA=1153 (561 added, 156 deleted, 436 changed) OCL=30738 CL=30781
2009-06-09mv src/lib to src/pkgRob Pike1-0/+372
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102