DateTimeOffset Struktura
Definice
Představuje bod v čase, který je obvykle vyjádřen jako datum a čas ve vztahu k koordinovanému světovému času (UTC).Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC).
public value class DateTimeOffset : IComparable, IComparable<DateTimeOffset>, IEquatable<DateTimeOffset>, IFormattable
public value class DateTimeOffset : IComparable, IComparable<DateTimeOffset>, IEquatable<DateTimeOffset>, IFormattable, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
public struct DateTimeOffset : IComparable, IComparable<DateTimeOffset>, IEquatable<DateTimeOffset>, IFormattable
public struct DateTimeOffset : IComparable, IComparable<DateTimeOffset>, IEquatable<DateTimeOffset>, IFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
[System.Serializable]
public struct DateTimeOffset : IComparable, IComparable<DateTimeOffset>, IEquatable<DateTimeOffset>, IFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
type DateTimeOffset = struct
interface IFormattable
type DateTimeOffset = struct
interface IFormattable
interface IDeserializationCallback
interface ISerializable
[<System.Serializable>]
type DateTimeOffset = struct
interface IFormattable
interface ISerializable
interface IDeserializationCallback
Public Structure DateTimeOffset
Implements IComparable, IComparable(Of DateTimeOffset), IEquatable(Of DateTimeOffset), IFormattable
Public Structure DateTimeOffset
Implements IComparable, IComparable(Of DateTimeOffset), IDeserializationCallback, IEquatable(Of DateTimeOffset), IFormattable, ISerializable
- Dědičnost
- Atributy
- Implementuje
Poznámky
DateTimeOffsetStruktura zahrnuje DateTime hodnotu spolu s Offset vlastností, která definuje rozdíl mezi DateTimeOffset datem a časem aktuální instance a KOORDINOVANÝ světový čas (UTC).The DateTimeOffset structure includes a DateTime value, together with an Offset property that defines the difference between the current DateTimeOffset instance's date and time and Coordinated Universal Time (UTC). Vzhledem k tomu, že přesně definuje datum a čas relativní ke standardu UTC, DateTimeOffset Struktura nezahrnuje Kind člena, jak DateTime Struktura provádí.Because it exactly defines a date and time relative to UTC, the DateTimeOffset structure does not include a Kind member, as the DateTime structure does. Představuje hodnoty data a času s hodnotami, jejichž rozsahy UTC jsou 12:00:00 půlnoci, 1. ledna 0001 Anno Domini (běžný životní postup), do 11:59:59. prosince, 31. prosince, 9999 N.L.It represents dates and times with values whose UTC ranges from 12:00:00 midnight, January 1, 0001 Anno Domini (Common Era), to 11:59:59 P.M., December 31, 9999 A.D. (0001).(C.E.).
Důležité
Mazání v japonských kalendářích vychází z Reign císaře a očekává se, že se změní.Eras in the Japanese calendars are based on the emperor's reign and are therefore expected to change. Například 1. května 2019 označený začátek období Reiwa v JapaneseCalendar a JapaneseLunisolarCalendar .For example, May 1, 2019 marked the beginning of the Reiwa era in the JapaneseCalendar and JapaneseLunisolarCalendar. Tato změna období ovlivňuje všechny aplikace, které tyto kalendáře používají.Such a change of era affects all applications that use these calendars. Další informace a určení, zda jsou aplikace ovlivněny, najdete v tématu zpracování nového období v japonském kalendáři v rozhraní .NET .See Handling a new era in the Japanese calendar in .NET for more information and to determine whether your applications are affected. Informace o testování vašich aplikací v systémech Windows a zajištění jejich připravenosti na změnu období najdete v tématu Příprava aplikace na změnu v japonském období .See Prepare your application for the Japanese era change for information on testing your applications on Windows systems to ensure their readiness for the era change. V tématu práce s mazáním najdete funkce v rozhraní .NET, které podporují kalendáře s více nástroji pro mazání a osvědčené postupy při práci s kalendáři podporujícími více funkcí mazání.See Working with eras for features in .NET that support calendars with multiple eras and for best practices when working with calendars that support multiple eras.
Časová komponenta DateTimeOffset hodnoty se měří v 100 jednotkách, které se nazývají takty, přičemž konkrétní datum je počet taktů od 12:00 půlnoci 1. ledna 0,001 N.l..The time component of a DateTimeOffset value is measured in 100-nanosecond units called ticks, and a particular date is the number of ticks since 12:00 midnight, January 1, 0001 A.D. 0001 v GregorianCalendar kalendáři.(C.E.) in the GregorianCalendar calendar. DateTimeOffsetHodnota je vždy vyjádřena v kontextu explicitního nebo výchozího kalendáře.A DateTimeOffset value is always expressed in the context of an explicit or default calendar. Značky, které jsou přičteny k přestupnosti sekund, nejsou zahrnuty v celkovém počtu tiků.Ticks that are attributable to leap seconds are not included in the total number of ticks.
I když DateTimeOffset hodnota zahrnuje posun, nejedná se o plně omezenou datovou strukturu, která zohledňuje časová pásma.Although a DateTimeOffset value includes an offset, it is not a fully time zone-aware data structure. I když je posun od času UTC jednou charakteristikou časového pásma, nejednoznačně identifikuje časové pásmo.While an offset from UTC is one characteristic of a time zone, it does not unambiguously identify a time zone. Nestačí, aby několik časových pásem sdílelo stejný posun od času UTC, ale posun v jednom časovém pásmu se změní, pokud sleduje letní čas.Not only do multiple time zones share the same offset from UTC, but the offset of a single time zone changes if it observes daylight saving time. To znamená, že jakmile DateTimeOffset je zrušeno přidružení hodnoty k časovému pásmu, již ji nelze jednoznačně propojit zpět k původnímu časovému pásmu.This means that, as soon as a DateTimeOffset value is disassociated from its time zone, it can no longer be unambiguously linked back to its original time zone.
Protože DateTimeOffset je struktura, DateTimeOffset objekt, který byl deklarován, ale není jinak inicializován, obsahuje výchozí hodnoty pro každé z jeho členských polí.Because DateTimeOffset is a structure, a DateTimeOffset object that has been declared but not otherwise initialized contains the default values for each of its member fields. To znamená, že jeho DateTime vlastnost je nastavena na DateTimeOffset.MinValue a jeho Offset vlastnost je nastavena na TimeSpan.Zero .This means that its DateTime property is set to DateTimeOffset.MinValue and its Offset property is set to TimeSpan.Zero.
Novou hodnotu lze vytvořit DateTimeOffset voláním kteréhokoli přetížení konstruktoru, který je podobný přetíženým konstruktorům DateTime struktury.You can create a new DateTimeOffset value by calling any of the overloads of its constructor, which are similar to the overloaded constructors for the DateTime structure. Novou hodnotu můžete vytvořit také DateTimeOffset tak, že jí přiřadíte DateTime hodnotu.You can also create a new DateTimeOffset value by assigning it a DateTime value. Toto je implicitní převod; nevyžaduje operátor přetypování (v jazyce C#) nebo volání metody převodu (v Visual Basic).This is an implicit conversion; it does not require a casting operator (in C#) or call to a conversion method (in Visual Basic). Můžete také inicializovat DateTimeOffset hodnotu z řetězcové reprezentace data a času voláním několika metod analýzy statických řetězců, které zahrnují Parse , ParseExact , TryParse a TryParseExact .You can also initialize a DateTimeOffset value from the string representation of a date and time by calling a number of static string parsing methods, which include Parse, ParseExact, TryParse, and TryParseExact.
Členové DateTimeOffset struktury poskytují funkce v následujících oblastech:The members of the DateTimeOffset structure provide functionality in the following areas:
Aritmetické operace s datem a časemDate and time arithmetic.
Z konkrétní hodnoty můžete přidat nebo odečíst buď kalendářní data nebo časové intervaly DateTimeOffset .You can add or subtract either dates or time intervals from a particular DateTimeOffset value. Aritmetické operace s DateTimeOffset hodnotami, na rozdíl od těch s DateTime hodnotami, se upraví pro rozdíly v časových posunech při vrácení výsledku.Arithmetic operations with DateTimeOffset values, unlike those with DateTime values, adjust for differences in time offsets when returning a result. Například následující kód používá DateTime proměnné pro odečtení aktuálního místního času z aktuálního času UTC.For example, the following code uses DateTime variables to subtract the current local time from the current UTC time. Kód pak pomocí DateTimeOffset proměnných provede stejnou operaci.The code then uses DateTimeOffset variables to perform the same operation. Odčítání s DateTime hodnotami vrátí rozdíl v místním časovém pásmu od času UTC, zatímco odčítání s DateTimeOffset hodnotami se vrátí TimeSpan.Zero .The subtraction with DateTime values returns the local time zone's difference from UTC, while the subtraction with DateTimeOffset values returns TimeSpan.Zero.
using System; public class DateArithmetic { public static void Main() { DateTime date1, date2; DateTimeOffset dateOffset1, dateOffset2; TimeSpan difference; // Find difference between Date.Now and Date.UtcNow date1 = DateTime.Now; date2 = DateTime.UtcNow; difference = date1 - date2; Console.WriteLine("{0} - {1} = {2}", date1, date2, difference); // Find difference between Now and UtcNow using DateTimeOffset dateOffset1 = DateTimeOffset.Now; dateOffset2 = DateTimeOffset.UtcNow; difference = dateOffset1 - dateOffset2; Console.WriteLine("{0} - {1} = {2}", dateOffset1, dateOffset2, difference); // If run in the Pacific Standard time zone on 4/2/2007, the example // displays the following output to the console: // 4/2/2007 7:23:57 PM - 4/3/2007 2:23:57 AM = -07:00:00 // 4/2/2007 7:23:57 PM -07:00 - 4/3/2007 2:23:57 AM +00:00 = 00:00:00 } }Module DateArithmetic Public Sub Main() Dim date1, date2 As Date Dim dateOffset1, dateOffset2 As DateTimeOffset Dim difference As TimeSpan ' Find difference between Date.Now and Date.UtcNow date1 = Date.Now date2 = Date.UtcNow difference = date1 - date2 Console.WriteLine("{0} - {1} = {2}", date1, date2, difference) ' Find difference between Now and UtcNow using DateTimeOffset dateOffset1 = date.Now dateOffset2 = date.UtcNow difference = dateOffset1 - dateOffset2 Console.WriteLine("{0} - {1} = {2}", _ dateOffset1, dateOffset2, difference) ' If run in the Pacific Standard time zone on 4/2/2007, the example ' displays the following output to the console: ' 4/2/2007 7:23:57 PM - 4/3/2007 2:23:57 AM = -07:00:00 ' 4/2/2007 7:23:57 PM -07:00 - 4/3/2007 2:23:57 AM +00:00 = 00:00:00 End Sub End ModuleOperace převodu typuType conversion operations.
Hodnoty můžete převést DateTimeOffset na DateTime hodnoty a naopak.You can convert DateTimeOffset values to DateTime values and vice versa.
Operace manipulace a extrakce času.Time manipulation and extraction operations.
Můžete extrahovat buď datum, nebo čas DateTimeOffset hodnoty.You can extract either the date or the time of a DateTimeOffset value. Můžete také načíst hodnotu konkrétní DateTimeOffset komponenty, například její rok nebo měsíc.You can also retrieve the value of a particular DateTimeOffset component, such as its year or its month.
Poznámka
Pokud pracujete s hodnotou osové hodnoty, kterou chcete převést na jiný časový interval, například minuty nebo sekundy, použijte TimeSpan.TicksPerDay TimeSpan.TicksPerHour TimeSpan.TicksPerMinute TimeSpan.TicksPerSecond TimeSpan.TicksPerMillisecond k provedení převodu konstantu,,, nebo.If you are working with a ticks value that you want to convert to some other time interval, such as minutes or seconds, you should use the TimeSpan.TicksPerDay, TimeSpan.TicksPerHour, TimeSpan.TicksPerMinute, TimeSpan.TicksPerSecond, or TimeSpan.TicksPerMillisecond constant to perform the conversion. Například chcete-li přidat počet sekund reprezentovaných zadaným počtem tiků do Second komponenty DateTimeOffset hodnoty, můžete použít výraz dateValue.Second + nTicks/Timespan.TicksPerSecond .For example, to add the number of seconds represented by a specified number of ticks to the Second component of a DateTimeOffset value, you can use the expression dateValue.Second + nTicks/Timespan.TicksPerSecond.
Převod data a času.Date and time conversion.
Libovolnou hodnotu můžete převést DateTimeOffset na jinou DateTimeOffset hodnotu, která představuje stejný bod v čase v jiném časovém pásmu.You can convert any DateTimeOffset value to another DateTimeOffset value that represents the same point in time in another time zone. Pravidla úpravy časového pásma se ale používají jenom v případě ToLocalTime metody, která převádí DateTimeOffset hodnotu na datum a čas v zóně místního systému.However, a time zone's adjustment rules are applied only in the case of the ToLocalTime method, which converts a DateTimeOffset value to the date and time in the local system zone.
Porovnání data a času.Date and time comparison.
Můžete určit, zda je jakákoli konkrétní DateTimeOffset hodnota nižší než, stejná jako nebo vyšší než jiná DateTimeOffset hodnota.You can determine whether any particular DateTimeOffset value is earlier than, the same as, or later than another DateTimeOffset value. Před provedením porovnání jsou všechny hodnoty převedeny na čas UTC.Before the comparison is performed, all values are converted to UTC.
Konstruktory
| DateTimeOffset(DateTime) |
Inicializuje novou instanci DateTimeOffset struktury pomocí zadané DateTime hodnoty.Initializes a new instance of the DateTimeOffset structure using the specified DateTime value. |
| DateTimeOffset(DateTime, TimeSpan) |
Inicializuje novou instanci DateTimeOffset struktury pomocí zadané DateTime hodnoty a posunu.Initializes a new instance of the DateTimeOffset structure using the specified DateTime value and offset. |
| DateTimeOffset(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Calendar, TimeSpan) |
Inicializuje novou instanci DateTimeOffset struktury pomocí zadaného roku, měsíce, dne, hodiny, minuty, sekundy, milisekund a posun zadaného kalendáře.Initializes a new instance of the DateTimeOffset structure using the specified year, month, day, hour, minute, second, millisecond, and offset of a specified calendar. |
| DateTimeOffset(Int32, Int32, Int32, Int32, Int32, Int32, Int32, TimeSpan) |
Inicializuje novou instanci DateTimeOffset struktury pomocí zadaného roku, měsíce, dne, hodiny, minuty, sekundy, milisekund a posunu.Initializes a new instance of the DateTimeOffset structure using the specified year, month, day, hour, minute, second, millisecond, and offset. |
| DateTimeOffset(Int32, Int32, Int32, Int32, Int32, Int32, TimeSpan) |
Inicializuje novou instanci DateTimeOffset struktury pomocí zadaného roku, měsíce, dne, hodiny, minuty, sekundy a posunu.Initializes a new instance of the DateTimeOffset structure using the specified year, month, day, hour, minute, second, and offset. |
| DateTimeOffset(Int64, TimeSpan) |
Inicializuje novou instanci DateTimeOffset struktury pomocí zadaného počtu taktů a posunu.Initializes a new instance of the DateTimeOffset structure using the specified number of ticks and offset. |
Pole
| MaxValue |
Představuje největší možnou hodnotu DateTimeOffset .Represents the greatest possible value of DateTimeOffset. Toto pole je jen ke čtení.This field is read-only. |
| MinValue |
Představuje nejstarší možnou DateTimeOffset hodnotu.Represents the earliest possible DateTimeOffset value. Toto pole je jen ke čtení.This field is read-only. |
| UnixEpoch |
Hodnota této konstanty je ekvivalentem 00:00:00.0000000 UTC, 1. ledna 1970 v gregoriánském kalendáři.The value of this constant is equivalent to 00:00:00.0000000 UTC, January 1, 1970, in the Gregorian calendar. UnixEpoch Definuje bod v čase, kdy se čas v systému UNIX rovná 0.UnixEpoch defines the point in time when Unix time is equal to 0. |
Vlastnosti
| Date |
Získá DateTime hodnotu, která představuje komponentu data aktuálního DateTimeOffset objektu.Gets a DateTime value that represents the date component of the current DateTimeOffset object. |
| DateTime |
Získá DateTime hodnotu, která představuje datum a čas aktuálního DateTimeOffset objektu.Gets a DateTime value that represents the date and time of the current DateTimeOffset object. |
| Day |
Vrátí den v měsíci reprezentovaný aktuálním DateTimeOffset objektem.Gets the day of the month represented by the current DateTimeOffset object. |
| DayOfWeek |
Vrátí den v týdnu reprezentovaný aktuálním DateTimeOffset objektem.Gets the day of the week represented by the current DateTimeOffset object. |
| DayOfYear |
Vrátí den v roce reprezentovaný aktuálním DateTimeOffset objektem.Gets the day of the year represented by the current DateTimeOffset object. |
| Hour |
Získá komponentu hodiny času reprezentovaného aktuálním DateTimeOffset objektem.Gets the hour component of the time represented by the current DateTimeOffset object. |
| LocalDateTime |
Získá DateTime hodnotu, která představuje místní datum a čas aktuálního DateTimeOffset objektu.Gets a DateTime value that represents the local date and time of the current DateTimeOffset object. |
| Millisecond |
Získá komponentu milisekund času reprezentovanou aktuálním DateTimeOffset objektem.Gets the millisecond component of the time represented by the current DateTimeOffset object. |
| Minute |
Načte složku minut času reprezentovaného aktuálním DateTimeOffset objektem.Gets the minute component of the time represented by the current DateTimeOffset object. |
| Month |
Načte komponentu měsíce data reprezentovaného aktuálním DateTimeOffset objektem.Gets the month component of the date represented by the current DateTimeOffset object. |
| Now |
Získá DateTimeOffset objekt, který je nastaven na aktuální datum a čas v aktuálním počítači, přičemž posun je nastaven na posun místního času od koordinovaného světového času (UTC).Gets a DateTimeOffset object that is set to the current date and time on the current computer, with the offset set to the local time's offset from Coordinated Universal Time (UTC). |
| Offset |
Získá časový posun od koordinovaného světového času (UTC).Gets the time's offset from Coordinated Universal Time (UTC). |
| Second |
Získá druhou součást času, reprezentovaného aktuálním DateTimeOffset objektem.Gets the second component of the clock time represented by the current DateTimeOffset object. |
| Ticks |
Získá počet tiků, které představují datum a čas aktuálního DateTimeOffset objektu v časovém intervalu.Gets the number of ticks that represents the date and time of the current DateTimeOffset object in clock time. |
| TimeOfDay |
Získá denní dobu pro aktuální DateTimeOffset objekt.Gets the time of day for the current DateTimeOffset object. |
| UtcDateTime |
Získá DateTime hodnotu, která představuje datum a čas koordinovaného univerzálního času (UTC) aktuálního DateTimeOffset objektu.Gets a DateTime value that represents the Coordinated Universal Time (UTC) date and time of the current DateTimeOffset object. |
| UtcNow |
Získá DateTimeOffset objekt, jehož datum a čas jsou nastaveny na aktuální koordinovaný světový čas (UTC) datum a čas a jehož posun je Zero .Gets a DateTimeOffset object whose date and time are set to the current Coordinated Universal Time (UTC) date and time and whose offset is Zero. |
| UtcTicks |
Získá počet tiků, které představují datum a čas aktuálního DateTimeOffset objektu v koordinovaném univerzálním čase (UTC).Gets the number of ticks that represents the date and time of the current DateTimeOffset object in Coordinated Universal Time (UTC). |
| Year |
Získá komponentu roku data reprezentovaného aktuálním DateTimeOffset objektem.Gets the year component of the date represented by the current DateTimeOffset object. |
Metody
| Add(TimeSpan) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný časový interval k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified time interval to the value of this instance. |
| AddDays(Double) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet celých a zlomkových dnů k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of whole and fractional days to the value of this instance. |
| AddHours(Double) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet celých a zlomkových hodin k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of whole and fractional hours to the value of this instance. |
| AddMilliseconds(Double) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet milisekund k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of milliseconds to the value of this instance. |
| AddMinutes(Double) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet celých a zlomkových minut k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of whole and fractional minutes to the value of this instance. |
| AddMonths(Int32) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet měsíců k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of months to the value of this instance. |
| AddSeconds(Double) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet celých a zlomkových sekund k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of whole and fractional seconds to the value of this instance. |
| AddTicks(Int64) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet tiků k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of ticks to the value of this instance. |
| AddYears(Int32) |
Vrátí nový DateTimeOffset objekt, který přidá zadaný počet roků k hodnotě této instance.Returns a new DateTimeOffset object that adds a specified number of years to the value of this instance. |
| Compare(DateTimeOffset, DateTimeOffset) |
Porovná dva DateTimeOffset objekty a označuje, zda je první předchozí než druhý, rovno druhé nebo pozdější než druhé.Compares two DateTimeOffset objects and indicates whether the first is earlier than the second, equal to the second, or later than the second. |
| CompareTo(DateTimeOffset) |
Porovná aktuální DateTimeOffset objekt se zadaným DateTimeOffset objektem a určí, zda aktuální objekt je dřívější než, stejné jako nebo pozdější než druhý DateTimeOffset objekt.Compares the current DateTimeOffset object to a specified DateTimeOffset object and indicates whether the current object is earlier than, the same as, or later than the second DateTimeOffset object. |
| Equals(DateTimeOffset) |
Určuje, zda aktuální DateTimeOffset objekt představuje stejný bod v čase jako zadaný DateTimeOffset objekt.Determines whether the current DateTimeOffset object represents the same point in time as a specified DateTimeOffset object. |
| Equals(DateTimeOffset, DateTimeOffset) |
Určuje, zda dva zadané DateTimeOffset objekty reprezentují stejný bod v čase.Determines whether two specified DateTimeOffset objects represent the same point in time. |
| Equals(Object) |
Určuje, zda DateTimeOffset objekt představuje stejný bod v čase jako zadaný objekt.Determines whether a DateTimeOffset object represents the same point in time as a specified object. |
| EqualsExact(DateTimeOffset) |
Určuje, zda aktuální DateTimeOffset objekt představuje stejný čas a má stejný posun jako zadaný DateTimeOffset objekt.Determines whether the current DateTimeOffset object represents the same time and has the same offset as a specified DateTimeOffset object. |
| FromFileTime(Int64) |
Převede zadaný čas souboru systému Windows na ekvivalentní místní čas.Converts the specified Windows file time to an equivalent local time. |
| FromUnixTimeMilliseconds(Int64) |
Převede čas systému UNIX vyjádřený jako počet milisekund, které uplynuly od roku 1970-01-01T00:00:00Z na DateTimeOffset hodnotu.Converts a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value. |
| FromUnixTimeSeconds(Int64) |
Převede čas systému UNIX vyjádřený jako počet sekund, které uplynuly od roku 1970-01-01T00:00:00Z na DateTimeOffset hodnotu.Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value. |
| GetHashCode() |
Vrátí hodnotu hash aktuálního DateTimeOffset objektu.Returns the hash code for the current DateTimeOffset object. |
| Parse(ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles) |
Převede určenou řetězcovou reprezentaci data a času na její DateTimeOffset ekvivalent pomocí zadaných informací o formátu a stylu formátování specifické jazykové verze.Converts the specified span representation of a date and time to its DateTimeOffset equivalent using the specified culture-specific format information and formatting style. |
| Parse(String) |
Převede určenou řetězcovou reprezentaci data, času a posunu na její DateTimeOffset ekvivalent.Converts the specified string representation of a date, time, and offset to its DateTimeOffset equivalent. |
| Parse(String, IFormatProvider) |
Převede určenou řetězcovou reprezentaci data a času na DateTimeOffset ekvivalent pomocí zadaných informací o formátu specifické jazykové verze.Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified culture-specific format information. |
| Parse(String, IFormatProvider, DateTimeStyles) |
Převede zadanou řetězcovou reprezentaci data a času na jeho DateTimeOffset ekvivalent pomocí zadaných informací o formátování a stylu formátování specifické jazykové verze.Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified culture-specific format information and formatting style. |
| ParseExact(ReadOnlySpan<Char>, ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles) |
Převede rozsah znaků, který představuje datum a čas na svůj DateTimeOffset ekvivalent pomocí zadaného formátu, informací o formátu specifické jazykové verze a stylu.Converts a character span that represents a date and time to its DateTimeOffset equivalent using the specified format, culture-specific format information, and style. Formát reprezentace data a času musí přesně odpovídat určenému formátu.The format of the date and time representation must match the specified format exactly. |
| ParseExact(ReadOnlySpan<Char>, String[], IFormatProvider, DateTimeStyles) |
Převede rozsah znaků, který obsahuje řetězcové vyjádření data a času na svůj DateTimeOffset ekvivalent pomocí zadaných formátů, informací o formátu specifických pro jazykovou verzi a stylu.Converts a character span that contains the string representation of a date and time to its DateTimeOffset equivalent using the specified formats, culture-specific format information, and style. Formát reprezentace data a času musí přesně odpovídat jednomu z určených formátů.The format of the date and time representation must match one of the specified formats exactly. |
| ParseExact(String, String, IFormatProvider) |
Převede určenou řetězcovou reprezentaci data a času na svůj DateTimeOffset ekvivalent pomocí zadaného formátu a informací o formátu specifické jazykové verze.Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified format and culture-specific format information. Formát řetězcového vyjádření musí přesně odpovídat určenému formátu.The format of the string representation must match the specified format exactly. |
| ParseExact(String, String, IFormatProvider, DateTimeStyles) |
Převede určenou řetězcovou reprezentaci data a času na svůj DateTimeOffset ekvivalent pomocí zadaného formátu, jazykové informace specifické pro jazykovou verzi a stylu.Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified format, culture-specific format information, and style. Formát řetězcového vyjádření musí přesně odpovídat určenému formátu.The format of the string representation must match the specified format exactly. |
| ParseExact(String, String[], IFormatProvider, DateTimeStyles) |
Převede určenou řetězcovou reprezentaci data a času na svůj DateTimeOffset ekvivalent pomocí zadaných formátů, informací o formátu specifických pro jazykovou verzi a stylu.Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified formats, culture-specific format information, and style. Formát řetězcového vyjádření musí přesně odpovídat jednomu z určených formátů.The format of the string representation must match one of the specified formats exactly. |
| Subtract(DateTimeOffset) |
Odečte DateTimeOffset hodnotu, která představuje konkrétní datum a čas z aktuálního DateTimeOffset objektu.Subtracts a DateTimeOffset value that represents a specific date and time from the current DateTimeOffset object. |
| Subtract(TimeSpan) |
Odečte zadaný časový interval od aktuálního DateTimeOffset objektu.Subtracts a specified time interval from the current DateTimeOffset object. |
| ToFileTime() |
Převede hodnotu aktuálního DateTimeOffset objektu na čas souboru systému Windows.Converts the value of the current DateTimeOffset object to a Windows file time. |
| ToLocalTime() |
Převede aktuální DateTimeOffset objekt na DateTimeOffset objekt, který představuje místní čas.Converts the current DateTimeOffset object to a DateTimeOffset object that represents the local time. |
| ToOffset(TimeSpan) |
Převede hodnotu aktuálního DateTimeOffset objektu na datum a čas určený hodnotou posunu.Converts the value of the current DateTimeOffset object to the date and time specified by an offset value. |
| ToString() |
Převede hodnotu aktuálního DateTimeOffset objektu na odpovídající řetězcovou reprezentaci.Converts the value of the current DateTimeOffset object to its equivalent string representation. |
| ToString(IFormatProvider) |
Převede hodnotu aktuálního DateTimeOffset objektu na odpovídající řetězcovou reprezentaci pomocí zadaných informací o formátování specifických pro jazykovou verzi.Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified culture-specific formatting information. |
| ToString(String) |
Převede hodnotu aktuálního DateTimeOffset objektu na odpovídající řetězcovou reprezentaci pomocí zadaného formátu.Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified format. |
| ToString(String, IFormatProvider) |
Převede hodnotu aktuálního DateTimeOffset objektu na odpovídající řetězcovou reprezentaci pomocí zadaného formátu a informací o formátu specifické jazykové verze.Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified format and culture-specific format information. |
| ToUniversalTime() |
Převede aktuální DateTimeOffset objekt na DateTimeOffset hodnotu, která představuje koordinovaný světový čas (UTC).Converts the current DateTimeOffset object to a DateTimeOffset value that represents the Coordinated Universal Time (UTC). |
| ToUnixTimeMilliseconds() |
Vrátí počet milisekund, které uplynuly od roku 1970-01-01T00:00:00.000 Z.Returns the number of milliseconds that have elapsed since 1970-01-01T00:00:00.000Z. |
| ToUnixTimeSeconds() |
Vrátí počet sekund, které uplynuly od roku 1970-01-01T00:00:00Z.Returns the number of seconds that have elapsed since 1970-01-01T00:00:00Z. |
| TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Pokusí se naformátovat hodnotu aktuální instance posunutí DateTime na zadaný rozsah znaků.Tries to format the value of the current datetime offset instance into the provided span of characters. |
| TryParse(ReadOnlySpan<Char>, DateTimeOffset) |
Pokusí se převést zadanou řetězcovou reprezentaci data a času na její DateTimeOffset ekvivalent a vrátí hodnotu, která označuje, zda převod proběhl úspěšně.Tries to convert a specified span representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded. |
| TryParse(ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles, DateTimeOffset) |
Pokusí se převést zadanou řetězcovou reprezentaci data a času na její DateTimeOffset ekvivalent a vrátí hodnotu, která označuje, zda převod proběhl úspěšně.Tries to convert a specified span representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded. |
| TryParse(String, DateTimeOffset) |
Pokusí se převést zadanou řetězcovou reprezentaci data a času na jeho DateTimeOffset ekvivalent a vrátí hodnotu, která označuje, zda převod proběhl úspěšně.Tries to converts a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded. |
| TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) |
Pokusí se převést zadanou řetězcovou reprezentaci data a času na jeho DateTimeOffset ekvivalent a vrátí hodnotu, která označuje, zda převod proběhl úspěšně.Tries to convert a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded. |
| TryParseExact(ReadOnlySpan<Char>, ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles, DateTimeOffset) |
Převede reprezentace data a času ve znakovém rozsahu na svůj DateTimeOffset ekvivalent pomocí zadaného formátu, jazykové informace specifické pro jazykovou verzi a stylu.Converts the representation of a date and time in a character span to its DateTimeOffset equivalent using the specified format, culture-specific format information, and style. Formát reprezentace data a času musí přesně odpovídat určenému formátu.The format of the date and time representation must match the specified format exactly. |
| TryParseExact(ReadOnlySpan<Char>, String[], IFormatProvider, DateTimeStyles, DateTimeOffset) |
Převede reprezentace data a času ve znakovém rozsahu na svůj DateTimeOffset ekvivalent pomocí zadaných formátů, informací o formátu specifických pro jazykovou verzi a stylu.Converts the representation of a date and time in a character span to its DateTimeOffset equivalent using the specified formats, culture-specific format information, and style. Formát reprezentace data a času musí přesně odpovídat jednomu z určených formátů.The format of the date and time representation must match one of the specified formats exactly. |
| TryParseExact(String, String, IFormatProvider, DateTimeStyles, DateTimeOffset) |
Převede určenou řetězcovou reprezentaci data a času na svůj DateTimeOffset ekvivalent pomocí zadaného formátu, jazykové informace specifické pro jazykovou verzi a stylu.Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified format, culture-specific format information, and style. Formát řetězcového vyjádření musí přesně odpovídat určenému formátu.The format of the string representation must match the specified format exactly. |
| TryParseExact(String, String[], IFormatProvider, DateTimeStyles, DateTimeOffset) |
Převede určenou řetězcovou reprezentaci data a času na svůj DateTimeOffset ekvivalent pomocí zadaného pole formátů, informací o formátu specifických pro jazykovou verzi a stylu.Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified array of formats, culture-specific format information, and style. Formát řetězcového vyjádření musí přesně odpovídat jednomu z určených formátů.The format of the string representation must match one of the specified formats exactly. |
Operátory
| Addition(DateTimeOffset, TimeSpan) |
Přidá zadaný časový interval do DateTimeOffset objektu, který má zadané datum a čas, a vytvoří DateTimeOffset objekt, který má nové datum a čas.Adds a specified time interval to a DateTimeOffset object that has a specified date and time, and yields a DateTimeOffset object that has new a date and time. |
| Equality(DateTimeOffset, DateTimeOffset) |
Určuje, zda dva zadané DateTimeOffset objekty reprezentují stejný bod v čase.Determines whether two specified DateTimeOffset objects represent the same point in time. |
| GreaterThan(DateTimeOffset, DateTimeOffset) |
Určuje, zda je jeden zadaný DateTimeOffset objekt větší než (nebo novější než) druhý zadaný DateTimeOffset objekt.Determines whether one specified DateTimeOffset object is greater than (or later than) a second specified DateTimeOffset object. |
| GreaterThanOrEqual(DateTimeOffset, DateTimeOffset) |
Určuje, zda jeden zadaný DateTimeOffset objekt je větší nebo roven druhému určenému DateTimeOffset objektu.Determines whether one specified DateTimeOffset object is greater than or equal to a second specified DateTimeOffset object. |
| Implicit(DateTime to DateTimeOffset) |
Definuje implicitní převod DateTime objektu na DateTimeOffset objekt.Defines an implicit conversion of a DateTime object to a DateTimeOffset object. |
| Inequality(DateTimeOffset, DateTimeOffset) |
Určuje, zda dva zadané DateTimeOffset objekty odkazují na jiné body v čase.Determines whether two specified DateTimeOffset objects refer to different points in time. |
| LessThan(DateTimeOffset, DateTimeOffset) |
Určuje, zda je jeden zadaný DateTimeOffset objekt menší než druhý zadaný DateTimeOffset objekt.Determines whether one specified DateTimeOffset object is less than a second specified DateTimeOffset object. |
| LessThanOrEqual(DateTimeOffset, DateTimeOffset) |
Určuje, zda je jeden zadaný DateTimeOffset objekt menší než druhý zadaný DateTimeOffset objekt.Determines whether one specified DateTimeOffset object is less than a second specified DateTimeOffset object. |
| Subtraction(DateTimeOffset, DateTimeOffset) |
Odečte jeden DateTimeOffset objekt od druhého a vypočítá časový interval.Subtracts one DateTimeOffset object from another and yields a time interval. |
| Subtraction(DateTimeOffset, TimeSpan) |
Odečte zadaný časový interval od zadaného data a času a vydává nové datum a čas.Subtracts a specified time interval from a specified date and time, and yields a new date and time. |
Explicitní implementace rozhraní
| IComparable.CompareTo(Object) |
Porovná hodnotu aktuálního DateTimeOffset objektu s jiným objektem stejného typu.Compares the value of the current DateTimeOffset object with another object of the same type. |
| IDeserializationCallback.OnDeserialization(Object) |
Spouští se po dokončení rekonstrukce objektu.Runs when the deserialization of an object has been completed. |
| ISerializable.GetObjectData(SerializationInfo, StreamingContext) |
Naplní SerializationInfo objekt daty potřebnými k serializaci aktuálního DateTimeOffset objektu.Populates a SerializationInfo object with the data required to serialize the current DateTimeOffset object. |