Skip to content

ls-ynevet/uk-timezone-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here’s a README file for the provided .NET Core application:


.NET Core Date and Time Application

This is a simple .NET Core application that demonstrates how to work with time zones and daylight saving time using the NodaTime library. The application retrieves the current time and converts it to the London time zone, checking whether it is daylight saving time.

Prerequisites

Application Overview

  • Main Program: The main program retrieves the current date and time, converts it to the London time zone, and checks if daylight saving time is active.
  • Docker Integration: The application is containerized using Docker. libfaketime is used to simulate different dates and times to test the application's behavior.

How to Build and Run

Build the Docker Image

To build the Docker image for this application, run the following command:

docker build -t dotnetcore31-date-app .

Running the Application

You can run the application using Docker with different simulated times:

Example 1: Simulating a specific date and time

docker run -e FAKE_TIME='2024-11-11 21:00:00' dotnetcore31-date-app 

Example 2: Simulating a date and time during Daylight Saving Time transition

  • Just before the Daylight Saving Time ends:
docker run -e FAKE_TIME='2024-10-27 00:59:00' dotnetcore31-date-app 
  • Just after the Daylight Saving Time ends:
docker run -e FAKE_TIME='2024-10-27 01:00:00' dotnetcore31-date-app 

Project Structure

  • Program.cs: Contains the main logic for retrieving and converting the date and time.
  • Dockerfile: Instructions to build and run the application inside a Docker container.
  • .csproj file: Defines the project and manages dependencies.

Dependencies

  • NodaTime (v3.1.11): A date and time library for .NET to handle time zones and more complex date/time scenarios.

Additional Information

  • libfaketime: A tool used to simulate different dates and times when running the application within a Docker container. This is useful for testing how the application behaves during different periods, such as Daylight Saving Time transitions.

License

This project is licensed under the MIT License.

Contact

For any questions or issues, please contact the author.


This README provides an overview of the application, its purpose, and instructions for building and running it, including how to simulate different times using libfaketime.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published