Documentation > CMS Template API Library > Asset > PublishDate

PublishDate

The asset's last publish date Might not be initialized, use HasValue to check.

Type

Nullable<DateTime>

Value

The time the asset was last published.

Code Example

C#

Sample:
	Asset myAsset = Asset.Load("/PathTo/Asset");	
	if(myAsset.IsLoaded)
	{
		Nullable<DateTime> publishedDT = myAsset.PublishDate;
		if(publishedDT.HasValue)
		{   
			Out.WriteLine("Published Date: " + publishedDT.ToString());
		}
	} 

Connect with Crownpeak