Skip to content

Commit

Permalink
Add return type switching note
Browse files Browse the repository at this point in the history
  • Loading branch information
BranislavLazic committed Sep 23, 2024
1 parent b25b2aa commit dce5fd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion postgres/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ var LOCALTIMESTAMP = jet.LOCALTIMESTAMP
// NOW returns current date and time
var NOW = jet.NOW

// DATE_TRUNC returns the truncated date and time using optional time zone
// DATE_TRUNC returns the truncated date and time using optional time zone.
// Use TimestampzExp if you need timestamp with time zone and IntervalExp if you need interval.
func DATE_TRUNC(field unit, source Expression, timezone ...string) TimestampExpression {
if len(timezone) > 0 {
return jet.NewTimestampFunc("DATE_TRUNC", jet.FixedLiteral(unitToString(field)), source, jet.FixedLiteral(timezone[0]))
Expand Down

0 comments on commit dce5fd6

Please sign in to comment.