MCPcopy
hub / github.com/seaweedfs/seaweedfs / CurrentTimestamp

Method CurrentTimestamp

weed/query/engine/datetime_functions.go:26–39  ·  view source on GitHub ↗

CurrentTimestamp returns the current timestamp

()

Source from the content-addressed store, hash-verified

24
25// CurrentTimestamp returns the current timestamp
26func (e *SQLEngine) CurrentTimestamp() (*schema_pb.Value, error) {
27 now := time.Now()
28
29 // Return as TimestampValue with microseconds
30 timestampMicros := now.UnixMicro()
31
32 return &schema_pb.Value{
33 Kind: &schema_pb.Value_TimestampValue{
34 TimestampValue: &schema_pb.TimestampValue{
35 TimestampMicros: timestampMicros,
36 },
37 },
38 }, nil
39}
40
41// CurrentTime returns the current time as a string in HH:MM:SS format
42func (e *SQLEngine) CurrentTime() (*schema_pb.Value, error) {

Callers 6

NowMethod · 0.95
TestDateTimeFunctionsFunction · 0.80

Calls 1

NowMethod · 0.80

Tested by 2

TestDateTimeFunctionsFunction · 0.64