Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeethnandakumar authored Jun 1, 2024
1 parent ceb72f2 commit 20b2c9e
Showing 1 changed file with 139 additions and 82 deletions.
221 changes: 139 additions & 82 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,179 @@
layout: default
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
## About
An easy to use utility to easily convert timezones from any timezones, countries, offsets, short and long names etc.. while leveraging the powerfull NodaTime and globaliazation in the background.

[Link to another page](./another-page.html).
> **Note**
> ***Starting from version v2.0+ and above, This is the official documentation. For older versions, Refer old documentation <a href="https://github.com/sangeethnandakumar/Twileloop.Timezone/blob/master/README_Old.md">
here
</a>***

There should be whitespace between paragraphs.
## License
> Twileloop.Timezone is licensed under the MIT License. See the LICENSE file for more details.
There should be whitespace between paragraphs. We recommend including a README, or a file with information about your project.
#### This library is absolutely free. If it gives you a smile, A small coffee would be a great way to support my work. Thank you for considering it!
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/sangeethnanda)

# Header 1

This is a normal paragraph following a header. GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.

## Header 2
## 1. Install Package
```bash
dotnet add package Twileloop.Timezone
```

> This is a blockquote following a header.
>
> When something is important enough, you do it even if the odds are not in your favor.
### Supported Features

| Status | From | 🡺 | To
| --- | --- | --- | ---
| ✅ | UTC timezone | 🡺 | System timezone
| ✅ | UTC timezone | 🡺 | Custom timezone
| ✅ | Custom timezone | 🡺 | UTC timezone
| ✅ | Custom timezone | 🡺 | Custom timezone
| ✅ | Timezone Abbreviation | 🡺 | Timezone Id
| ✅ | Timezone Id | 🡺 | Timezone Abbreviation
| ✅ | Timezone Id | 🡺 | Country ISO Codes (Under that timezone)
| ✅ | Country ISO Code | 🡺 | Timezone Ids (Under that country)
| ✅ | Country Name | 🡺 | Country ISO Code
| ✅ | Country ISO Code | 🡺 | Country Name

## 2. System timezone 🡺 UTC timezone

```csharp
//System timezone 🡺 UTC timezone
var utcTime = DateTime.UtcNow;
```

### Header 3
## 3. UTC timezone 🡺 System timezone

```js
// Javascript code with syntax highlighting.
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l)
return true;
}
```csharp
//UTC timezone 🡺 System timezone
var mySystemTime = utcTime.UtcToSystemTimezone();
```

```ruby
# Ruby code with syntax highlighting
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
## 4. UTC timezone 🡺 Custom timezone

```csharp
//UTC timezone 🡺 Custom timezone
var japanTime = utcTime.UtcToCustomTimezone("Asia/Tokyo");
```

#### Header 4
## 5. Custom timezone 🡺 UTC timezone

* This is an unordered list following a header.
* This is an unordered list following a header.
* This is an unordered list following a header.
```csharp
//Custom timezone 🡺 UTC timezone
var japanTimeInUtc = japanTime.CustomTimezoneToUtc("Asia/Tokyo");
```

##### Header 5
## 6. Custom timezone 🡺 Custom timezone

1. This is an ordered list following a header.
2. This is an ordered list following a header.
3. This is an ordered list following a header.
```csharp
//Custom timezone 🡺 Custom timezone
var indianTime = japanTime.MigrateToTimezone("Asia/Tokyo", "Asia/Kolkata");
```

###### Header 6
## 7. Timezone Abbreviation 🡺 Timezone Id

| head1 | head two | three |
|:-------------|:------------------|:------|
| ok | good swedish fish | nice |
| out of stock | good and plenty | nice |
| ok | good `oreos` | hmm |
| ok | good `zoute` drop | yumm |
```csharp
// Timezone Abbreviation 🡺 Timezone Id
var abbreviation = "IST";
var (displayName, timeZoneIds) = TimezoneHelper.AbbreviationToTimezone(abbreviation);

### There's a horizontal rule below this.
Console.WriteLine($"Abbreviation: {abbreviation}");
Console.WriteLine($"Full Display Name: {displayName}");
Console.WriteLine("Time Zone Identifiers:");

* * *
foreach (var timeZoneIda in timeZoneIds)
{
Console.WriteLine(timeZoneIda);
}
```

### Here is an unordered list:
## 8. Timezone Id 🡺 Timezone Abbreviation

* Item foo
* Item bar
* Item baz
* Item zip
```csharp
// Timezone Id 🡺 Timezone Abbreviation
var timeZoneId = "Asia/Kolkata";
var (zoneAbbreviation, zoneDisplayName) = TimezoneHelper.TimezoneToAbbreviation(timeZoneId);

### And an ordered list:
Console.WriteLine($"Time Zone Identifier: {timeZoneId}");
Console.WriteLine($"Abbreviation: {zoneAbbreviation}");
Console.WriteLine($"Full Display Name: {zoneDisplayName}");
```

1. Item one
1. Item two
1. Item three
1. Item four
## 9. Timezone Id 🡺 Countries Under Timezone

### And a nested list:
```csharp
// Timezone Id 🡺 Country Codes
string timezone = "America/New_York";
List<(string CountryCode, string CountryName)> countriesUnderTimezone = TimezoneHelper.GetCountriesUnderTimezone(timezone);

- level 1 item
- level 2 item
- level 2 item
- level 3 item
- level 3 item
- level 1 item
- level 2 item
- level 2 item
- level 2 item
- level 1 item
- level 2 item
- level 2 item
- level 1 item
Console.WriteLine($"Countries under timezone '{timezone}':");
foreach (var country in countriesUnderTimezone)
{
Console.WriteLine($"{country.CountryCode} | {country.CountryName}");
}
```

### Small image
## 10. Country ISO Code 🡺 Timezones Under Country

![Octocat](https://github.githubassets.com/images/icons/emoji/octocat.png)
```csharp
// Country Code 🡺 Timezones
string countryCode = "US";
List<string> timezones = TimezoneHelper.GetTimezonesUnderCountry(countryCode);
Console.WriteLine($"Timezones under country '{countryCode}':");
foreach (string tz in timezones)
{
Console.WriteLine($"{tz}");
}
```

### Large image
## 11. Country Name 🡺 Country ISO Code

![Branching](https://guides.github.com/activities/hello-world/branching.png)
```csharp
// Country Name 🡺 Country Code
string countryName = "United States";
string isoCountryCode = TimezoneHelper.CountryNameToAbbreviation(countryName);
Console.WriteLine($"Country name '{countryName}' has the abbreviation: {isoCountryCode}");
```

## 12. Country ISO Code 🡺 Country Names

### Definition lists can be used with HTML syntax.
```csharp
// Country Code 🡺 Country Name
string isoCode = "US";
string fullCountryName = TimezoneHelper.AbbreviationToCountryName(isoCode);
Console.WriteLine($"Abbreviation '{isoCode}' corresponds to the country: {fullCountryName}");
```

<dl>
<dt>Name</dt>
<dd>Godzilla</dd>
<dt>Born</dt>
<dd>1952</dd>
<dt>Birthplace</dt>
<dd>Japan</dd>
<dt>Color</dt>
<dd>Green</dd>
</dl>
## 13. Timezones Sharing Same Offset (In Minuits)

```csharp
//Find timezones sharing same offset (+5:30 is 330 mins)
var timezonesSharingSameOffset = TimezoneHelper.OffsetToTimezones(330);
timezonesSharingSameOffset.ForEach(timeZone =>
{
Console.WriteLine(timeZone.DisplayName);
});
```
Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
```

## 14. All Timezones

```csharp
//Get all timezones
var allTimezones = TimezoneHelper.GetAllTimezones();
allTimezones.ForEach(timeZone =>
{
Console.WriteLine(timeZone.ToString());
});
```
The final element.

## 15. All Countries

```csharp
//Get all countries
List<(string CountryCode, string CountryName)> allCountries = TimezoneHelper.GetAllCountries();
allCountries.ForEach(country =>
{
Console.WriteLine($"{country.CountryCode} | {country.CountryName}");
});
```

0 comments on commit 20b2c9e

Please sign in to comment.