@@ -22,8 +22,6 @@ import (
2222 "time"
2323
2424 "gopkg.in/src-d/go-errors.v1"
25-
26- gmstime "github.com/dolthub/go-mysql-server/internal/time"
2725)
2826
2927const EventDateSpaceTimeFormat = "2006-01-02 15:04:05"
@@ -83,32 +81,32 @@ type EventDefinition struct {
8381func (e * EventDefinition ) ConvertTimesFromUTCToTz (tz string ) * EventDefinition {
8482 ne := * e
8583 if ne .HasExecuteAt {
86- t , ok := gmstime . ConvertTimeZone (e .ExecuteAt , "+00:00" , tz )
84+ t , ok := ConvertTimeZone (e .ExecuteAt , "+00:00" , tz )
8785 if ok {
8886 ne .ExecuteAt = t
8987 }
9088 } else {
91- t , ok := gmstime . ConvertTimeZone (e .Starts , "+00:00" , tz )
89+ t , ok := ConvertTimeZone (e .Starts , "+00:00" , tz )
9290 if ok {
9391 ne .Starts = t
9492 }
9593 if ne .HasEnds {
96- t , ok = gmstime . ConvertTimeZone (e .Ends , "+00:00" , tz )
94+ t , ok = ConvertTimeZone (e .Ends , "+00:00" , tz )
9795 if ok {
9896 ne .Ends = t
9997 }
10098 }
10199 }
102100
103- t , ok := gmstime . ConvertTimeZone (e .CreatedAt , "+00:00" , tz )
101+ t , ok := ConvertTimeZone (e .CreatedAt , "+00:00" , tz )
104102 if ok {
105103 ne .CreatedAt = t
106104 }
107- t , ok = gmstime . ConvertTimeZone (e .LastAltered , "+00:00" , tz )
105+ t , ok = ConvertTimeZone (e .LastAltered , "+00:00" , tz )
108106 if ok {
109107 ne .LastAltered = t
110108 }
111- t , ok = gmstime . ConvertTimeZone (e .LastExecuted , "+00:00" , tz )
109+ t , ok = ConvertTimeZone (e .LastExecuted , "+00:00" , tz )
112110 if ok {
113111 ne .LastExecuted = t
114112 }
@@ -363,7 +361,7 @@ var tzRegex = regexp.MustCompile(`(?m)^([+\-])(\d{2}):(\d{2})$`)
363361// evaluating valid MySQL datetime and timestamp formats.
364362func GetTimeValueFromStringInput (field , t string ) (time.Time , error ) {
365363 // TODO: the time value should be in session timezone rather than system timezone.
366- sessTz := gmstime . SystemTimezoneOffset ()
364+ sessTz := SystemTimezoneOffset ()
367365
368366 // For MySQL datetime format, it accepts any valid date format
369367 // and tries parsing time part first and timezone part if time part is valid.
@@ -407,7 +405,7 @@ func GetTimeValueFromStringInput(field, t string) (time.Time, error) {
407405 }
408406
409407 // convert the time value to the session timezone for display and storage
410- tVal , ok = gmstime . ConvertTimeZone (tVal , inputTz , sessTz )
408+ tVal , ok = ConvertTimeZone (tVal , inputTz , sessTz )
411409 if ! ok {
412410 return time.Time {}, fmt .Errorf ("invalid time zone: %s" , sessTz )
413411 }
0 commit comments