Solarion
Honorary Master
- Joined
- Nov 14, 2012
- Messages
- 28,055
- Reaction score
- 17,809
I am wanting to save a dateofbirth into an SQL table as an integer. Then when retrieving the dateofbirth from SQL I will convert this integer back to the date of birth.
I have literally inputted the value into the table for now which is 1072540000 so actually converting back to a date time is the easy part. However I would like to save the date back into the table as it's unix value but there is a mismatch: System.InvalidCastException: 'Invalid cast from 'DateTime' to 'Int32'.'
How the heck do I achieve this when my DateofBirth property is a DateTime?
I have literally inputted the value into the table for now which is 1072540000 so actually converting back to a date time is the easy part. However I would like to save the date back into the table as it's unix value but there is a mismatch: System.InvalidCastException: 'Invalid cast from 'DateTime' to 'Int32'.'
How the heck do I achieve this when my DateofBirth property is a DateTime?