NET Caching Library Help
GetLastDayOfMonth Method
Example 




KellermanSoftware.NetCachingLibrary Namespace > SmartCache Class : GetLastDayOfMonth Method
Gets the last day of the month.
Syntax
'Declaration
 
Public Function GetLastDayOfMonth() As System.DateTimeOffset
'Usage
 
Dim instance As SmartCache
Dim value As System.DateTimeOffset
 
value = instance.GetLastDayOfMonth()
public System.DateTimeOffset GetLastDayOfMonth()
public: System.DateTimeOffset GetLastDayOfMonth(); 
public:
System.DateTimeOffset GetLastDayOfMonth(); 

Return Value

DateTimeOffset.
Example
//Create a Primary Memory Cache with a backing File Cache
string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "KellermanSoftware", "NetCachingLibrary", "Tests");
SmartConfig config = new SmartConfig(new MemoryCacheProvider(), new FileCacheProvider(directory));
            
//Specify UserName and LicenseKey for Licensed Mode
//config.UserName = "my user name";
//config.LicenseKey = "my license key";
            
//Instantiate the cache
SmartCache cache = new SmartCache(config);
            
//Get the last day of the month
DateTimeOffset lastDayOfMonth = cache.GetLastDayOfMonth();
            
Console.WriteLine(lastDayOfMonth);
'Create a Primary Memory Cache with a backing File Cache
Dim directory As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "KellermanSoftware", "NetCachingLibrary", "Tests")
Dim config As New SmartConfig(New MemoryCacheProvider(), New FileCacheProvider(directory))
            
'Specify UserName and LicenseKey for Licensed Mode
'config.UserName = "my user name";
'config.LicenseKey = "my license key";
            
'Instantiate the cache
Dim cache As New SmartCache(config)
            
'Get the last day of the month
Dim lastDayOfMonth As DateTimeOffset = cache.GetLastDayOfMonth()
            
Console.WriteLine(lastDayOfMonth)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SmartCache Class
SmartCache Members