MetadataConversionExtensions.

DateTime(IMetadata, string, DateTime) Method

Summary

Gets the value for the specified key converted to a Wyam.Common.Meta.MetadataConversionExtensions.DateTime(Wyam.Common.Meta.IMetadata,System.String,System.DateTime). This method never throws an exception. It will return the specified default value if the key is not found.

Syntax

public static DateTime DateTime(this IMetadata metadata, string key, DateTime defaultValue = null)

Parameters

Name Type Description
metadata IMetadata The metadata containing the value.
key string The key of the value to get.
defaultValue DateTime The default value to use if the key is not found or cannot be converted to a Wyam.Common.Meta.MetadataConversionExtensions.DateTime(Wyam.Common.Meta.IMetadata,System.String,System.DateTime).

Return Value

Type Description
DateTime The value for the specified key converted to a Wyam.Common.Meta.MetadataConversionExtensions.DateTime(Wyam.Common.Meta.IMetadata,System.String,System.DateTime) or the specified default value.
GitHub