C# Class Recipes.Contracts.FormatUtil

Pretty format utils
Afficher le fichier Open project: gnschenker/RecipesWithCqrsAndEs

Méthodes publiques

Méthode Description
SizeInBytes ( long sizeInBytes ) : string

Formats the size in bytes to a pretty string.

TimeOffset ( System.DateTime localTime ) : string

Displays time passed since some event expressed, displaying it as '5 days ago'.

TimeOffsetUtc ( System.DateTime dateInUtc ) : string

Displays time passed since (or remaining before) some event expressed in UTC, displaying it as '5 days ago'.

TimeSpan ( System.TimeSpan offset ) : string

Formats time span nicely

Private Methods

Méthode Description
FormatUtil ( ) : System
PositiveTimeSpan ( System.TimeSpan timeSpan ) : string

Method Details

SizeInBytes() public static méthode

Formats the size in bytes to a pretty string.
public static SizeInBytes ( long sizeInBytes ) : string
sizeInBytes long The size in bytes.
Résultat string

TimeOffset() public static méthode

Displays time passed since some event expressed, displaying it as '5 days ago'.
public static TimeOffset ( System.DateTime localTime ) : string
localTime System.DateTime The local time.
Résultat string

TimeOffsetUtc() public static méthode

Displays time passed since (or remaining before) some event expressed in UTC, displaying it as '5 days ago'.
public static TimeOffsetUtc ( System.DateTime dateInUtc ) : string
dateInUtc System.DateTime The date in UTC.
Résultat string

TimeSpan() public static méthode

Formats time span nicely
public static TimeSpan ( System.TimeSpan offset ) : string
offset System.TimeSpan The offset.
Résultat string