home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
SQLite sorting of DateTime values..... how?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ojo" data-source="post: 5489" data-attributes="member: 10402"><p>What about this solution:</p><p></p><p>Using string but converting to yyyyMMdd format.</p><p></p><p>Due to the year, then month, then day and the zero padding you will be able to sort in SQL. It's even human readable.....</p><p></p><p>[code]string sDate = String.Format("{0:yyyyMMdd}",DateTime.Now);[/code]</p><p>and the other way around </p><p></p><p>[code]DateTime dDate = DateTime.ParseExact("20041231","yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);[/code]</p><p>This should handle your problem. By converting to C# DateTime before doing any date-time calculations this should work like a charm.</p><p></p><p>What do you think ?</p><p></p><p>;-) Ojo</p></blockquote><p></p>
[QUOTE="ojo, post: 5489, member: 10402"] What about this solution: Using string but converting to yyyyMMdd format. Due to the year, then month, then day and the zero padding you will be able to sort in SQL. It's even human readable..... [code]string sDate = String.Format("{0:yyyyMMdd}",DateTime.Now);[/code] and the other way around [code]DateTime dDate = DateTime.ParseExact("20041231","yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);[/code] This should handle your problem. By converting to C# DateTime before doing any date-time calculations this should work like a charm. What do you think ? ;-) Ojo [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
SQLite sorting of DateTime values..... how?
Contact us
RSS
Top
Bottom