NKnusperer
NKnusperer

Reputation: 984

How to set Linux/Mac computer clock with C#/Mono?

how can I programmatically set the hardware computer clock under Linux and Mac in C# with the Mono CLR?

EDIT:

I created a C# library to do this, so if everyone else need this function, grab it here:

https://github.com/mc-kay/sharp-timetools/

Upvotes: 4

Views: 2275

Answers (1)

basarat
basarat

Reputation: 276135

You will need to use PInvoke (documentation : http://www.mono-project.com/Interop_with_Native_Libraries) the native (c/c++) functions for this. For linux the native function / struct is listed here : How Do You Programmatically Set the Hardware Clock on Linux?

Upvotes: 2

Related Questions