Reputation: 6518
I have an integer number which represents number of minutes. I need to display that number in dd:HH:mm format to user.
Converting number of minutes to dd:HH:mm format is not a problem. my Question is related to adding culture specific abbreviated letters for days, hours and minutes.
Is there anything like culture specific abbreviated sign for day, hour and minutes? Output would look something like this:
1d 20h 46m
but d, h, and m would be culture specific. Is this possible, or I need to do custom localization?
Upvotes: 2
Views: 170
Reputation: 1500495
I don't believe there's anything within the .NET culture information which gives this information, no. If there were, it would be in DateTimeFormatInfo
.
If (as I suspect) you can't find what you're looking for within the .NET classes, you might find that CLDR has the relevant information - although it may take you a while to find it. If you can validate that it really does have the information, the NCLDR project might help you use it from .NET a bit more easily.
(Just before anyone asks, my Noda Time project does not have this information. It allows you to format a duration or period, but it doesn't know any culture-specific suffixes to use.)
Upvotes: 1