You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
I use the phoenix to create a table (eg:user table) including the property using date type,then get this value using PrepareAndExecuteRequestAsync method.But I find the value's Rep is integer type not JavaSqlDate or JavaSqlTime or JavaUtilDate and its columnclassname is "java.sql.Date",so How to get or convert the corrent value of datetime? Could you give me an an example? Thanks.
The text was updated successfully, but these errors were encountered:
I know it's been a little while you posted this but in case anybody stumbles on this,
Basically, I discovered that if the data type from DB is Date, then the value returned would be Rep.Integer which would indicate a number of days after 1/1/1970. If the date type from DB is DateTime, then the value returned is Rep.Long which indicates the number of milliseconds after 1/1/1970.
publicDateTimeConvertToCSharpType(TypedValuevalue){varstartDate=newDateTime(1970,1,1,0,0,0,DateTimeKind.Utc);if(value.Type==Rep.Integer)returnstartDate.AddDays(value.NumberValue);elseif(value.Type==Rep.Long)returnstartDate.AddMilliseconds(value.NumberValue);elsethrownewNotImplementedException($"Cannot convert value type {value.Type} to DateTime because it is not implemented");}`
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I use the phoenix to create a table (eg:user table) including the property using date type,then get this value using PrepareAndExecuteRequestAsync method.But I find the value's Rep is integer type not JavaSqlDate or JavaSqlTime or JavaUtilDate and its columnclassname is "java.sql.Date",so How to get or convert the corrent value of datetime? Could you give me an an example? Thanks.
The text was updated successfully, but these errors were encountered: