C# Class Recipes.Contracts.FormatUtil

Pretty format utils
Mostrar archivo Open project: gnschenker/RecipesWithCqrsAndEs

Public Methods

Method 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

Method Description
FormatUtil ( ) : System
PositiveTimeSpan ( System.TimeSpan timeSpan ) : string

Method Details

SizeInBytes() public static method

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

TimeOffset() public static method

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.
return string

TimeOffsetUtc() public static method

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.
return string

TimeSpan() public static method

Formats time span nicely
public static TimeSpan ( System.TimeSpan offset ) : string
offset System.TimeSpan The offset.
return string