Skip to content

Commit a5b68ac

Browse files
Revert "Add partial Markdown for handling Timestamp block based on version (#…" (#7217)
This reverts commit 8acfcaf.
1 parent 8acfcaf commit a5b68ac

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

nservicebus/messaging/headers.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ The headers of a message are similar to HTTP headers and contain metadata about
1717

1818
## Timestamp format
1919

20-
#if-version [8,)
21-
For all timestamp message headers, the format is `yyyy-MM-dd HH:mm:ss:ffffff Z` where the time is UTC. The helper class `DateTimeOffsetHelper` supports converting from UTC to wire format and vice versa by using the `ToWireFormattedString()` and `ToDateTimeOffset()` methods.
22-
#end-if
23-
24-
#if-version [,8)
2520
For all timestamp message headers, the format is `yyyy-MM-dd HH:mm:ss:ffffff Z` where the time is UTC. The helper class `DateTimeExtensions` supports converting from UTC to wire format and vice versa by using the `ToWireFormattedString()` and `ToUtcDateTime()` methods.
26-
#end-if
2721

2822
### ISO 8601 format
2923

@@ -48,30 +42,17 @@ Use the following code to generate or read the NServiceBus custom timestamp form
4842
```cs
4943
const string Format = "yyyy-MM-dd HH:mm:ss:ffffff Z"; // Not ISO 8601
5044
51-
#if-version [8,)
52-
public static string ToWireFormattedString(DateTimeOffset dateTime)
53-
{
54-
return dateTime.ToUniversalTime().ToString(format, CultureInfo.InvariantCulture);
55-
}
56-
public static DateTimeOffset ToUtcDateTime(string wireFormattedString)
57-
{
58-
return DateTimeOffset.ParseExact(wireFormattedString, Format, CultureInfo.InvariantCulture)
59-
.ToUniversalTime();
60-
}
61-
#end-if
62-
63-
#if-version [,8)
6445
public static string ToWireFormattedString(DateTime dateTime)
6546
{
6647
return dateTime.ToUniversalTime()
6748
.ToString(Format, CultureInfo.InvariantCulture);
6849
}
50+
6951
public static DateTime ToUtcDateTime(string wireFormattedString)
7052
{
7153
return DateTime.ParseExact(wireFormattedString, Format, CultureInfo.InvariantCulture)
7254
.ToUniversalTime();
7355
}
74-
#end-if
7556
```
7657

7758
## Transport headers

0 commit comments

Comments
 (0)