DateTimeOffset.Minute Propiedad

Definición

Obtiene el componente de minuto de la hora representada por el objeto DateTimeOffset actual.

public:
 property int Minute { int get(); };
public int Minute { get; }
member this.Minute : int
Public ReadOnly Property Minute As Integer

Valor de propiedad

Int32

Componente de minuto del objeto DateTimeOffset actual, expresado como un entero entre 0 y 59.

Ejemplos

En el ejemplo siguiente se muestra el componente de minuto de un DateTimeOffset objeto de tres maneras diferentes:

  • Recuperando el valor de la Minute propiedad .

  • Llamando al ToString(String) método con el especificador de formato "m".

  • Llamando al ToString(String) método con el especificador de formato "mm".

DateTimeOffset theTime = new DateTimeOffset(2008, 5, 1, 10, 3, 0,
                                           DateTimeOffset.Now.Offset);
Console.WriteLine("The minute component of {0} is {1}.",
                  theTime, theTime.Minute);

Console.WriteLine("The minute component of {0} is{1}.",
                  theTime, theTime.ToString(" m"));

Console.WriteLine("The minute component of {0} is {1}.",
                  theTime, theTime.ToString("mm"));
// The example produces the following output:
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 03.
let theTime = DateTimeOffset(2008, 5, 1, 10, 3, 0, DateTimeOffset.Now.Offset)
printfn $"The minute component of {theTime} is {theTime.Minute}."

printfn $"""The minute component of {theTime} is{theTime.ToString " m"}."""

printfn $"The minute component of {theTime} is {theTime:mm}."

// The example produces the following output:
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 03.
Dim theTime As New DateTimeOffset(#5/1/2008 10:03AM#, _
                                       DateTimeOffset.Now.Offset)
Console.WriteLine("The minute component of {0} is {1}.", _
                  theTime, theTime.Minute)

Console.WriteLine("The minute component of {0} is{1}.", _
                  theTime, theTime.ToString(" m"))

Console.WriteLine("The minute component of {0} is {1}.", _
                  theTime, theTime.ToString("mm"))
' The example produces the following output:
'    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
'    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
'    The minute component of 5/1/2008 10:03:00 AM -08:00 is 03.

Comentarios

La Minute propiedad no se ve afectada por el valor de la Offset propiedad .

También puede crear una representación de cadena del componente minute de un DateTimeOffset objeto llamando al ToString método con los especificadores de formato personalizado "m" o "mm".

Se aplica a