score:5
i'm guessing twittime
is a string
, in which case you would need a format like "yyyy/mm/dd hh:mm:ss"
if you wanted to search it without parsing. simply, alphabetical sorting doesn't work if the most significant part (the year) is at the right-hand-side.
however: a better approach would be: store it in a datetime
- that will sort safely.
score:5
when sorting string
s, they are usually compared lexicographically, meaning all strings starting with number 1
will be together:
1
10
2
3
...
when sorting a date or a time, you could use iso8601 dates, e.g. 2013-01-01 12:34:23, that happens to sort correctly lexicographically. many platforms and languages also support correct date comparison function you could use.
Source: stackoverflow.com
Related Query
- Sorting not working for the year "2013"
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- Could not find an implementation of the query pattern for source type
- System.Linq.Dynamic not working for the Entity Framework
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet` 'Where' not found
- Getting "Could not find an implementation of the query pattern for source type 'ExcelQueryable<T>'. " Error
- Could not find an implementation of the query pattern for source type 'Join'
- C# LINQ code not working for XML parse
- Using multiple LINQ statements with into , for the DefaultIfEmpty() of the left outer join not working
- The data source does not support server-side data paging
- Using only the year part of a date for a WHERE condition
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- The binary operator Multiply is not defined for the types 'System.Int32' and 'System.Double'.
- ThenInclude not working for an Entity Framework LINQ query
- Update an item in the list not working
- LINQ "The return types for the following stored procedures could not be detected" (NOT temp tables)
- LINQ not working for strings in Xamarin?
- Linq OrderBy not sorting correctly 100% of the time
- The data reader has more than one field. Multiple fields are not valid for EDM primitive types
- realm.xamarin throws error: The method 'Contains' is not supported. same for 'Any'
- Refactor Linq code and "LINQ to Entities does not recognize the method"
- Linq Expressions: The binary operator Equal is not defined for the types 'MyEnum' and 'System.Enum'
- Haven't jumped on the Linq bandwagon, what are your reasons for not using linq?
- linq - how do you do a query for items in one query source that are not in another one?
- Decimal.ToString not working if the value is zero
- Ienumerable concat not working in for each loop
- Avoid extra loop and could not find implementation of query pattern for source type int Select not found
- SQL OrderBy clause for alphanumeric data in LINQ not sorting as expected
- Determine the source DataContext for a Linq to Sql query
- OrderBy numbers and ThenBy boolean not working for List
More Query from same tag
- How to obtain the maximum datetime of each item2 & item3 combination?
- GroupBy in LINQ query, with many-to-many relational
- C# ASP.NET Sort XML Nodes by custom attribute
- Linq query - ON clause of inner join cannot compare two Guids
- Anonymous methods vs Extension method vs Lambda expression vs Linq
- How do I find the intersection of 2 sets in my logfile (using LINQ)
- Adding `MethodCallExpression` on top of provided `Expression`
- using dt.AsEnumerable().Sum for columns having string/null value
- Problems with passing two models to one view
- LINQ to SQL - updating records
- Fetch data from Ignite using AsCacheQueryable with Generic query perfromance efficient
- Using Linq to shape structure for Json serialization
- How to create a simple left outer join in lambda expression in EF ASP.NET MVC5
- Linq group by grouping wrong set of results
- Dictionary to XML using LINQ
- where on LINQ query
- Why does LINQ SelectMany ignore includes? (and in fact removes loaded data)
- Get MethodInfo for Enumerable.First() vs MethodInfo for Enumerable.OfType()?
- mongodb linq provider: incorrect behavior for fields of type decimal?
- Find frequencies of a specific property value in a list<object>
- How to merge two lists based on a property?
- List in asp.net linq query not working
- How to write this complex LINQ to Entities query
- Creating a linq expression dynamically or parsing the string value of the expression
- MonoDevelop 3.1.1 can't find System.Xml.Linq
- How to change one of the property linq
- c# linq return child table rows using composite foreign key columns
- How to find the last item from list have the same item using linq
- XElement and it's attributes
- Getting a set of elements using linq