# How can I know the boot date/time of my FreeBSD system?



## Sopalajo (Sep 13, 2019)

I would like to know the date/hour when my FreeBSD performed the last boot via command-line .

I know about the 
	
	



```
uptime
```
 command, but it seems to report only the time spent since the booting, so I was wondering if there is any more direct method that does not require mathematical operations over dates .

On Unix systems, I think some files like 
	
	



```
/proc/stat
```
 or 
	
	



```
/proc/uptime
```
 are created at boot, so I could just use their timestamps. But these files don't seem to exist on FreeBSD, and I don't know what are their equivalents.

Any ideas, please?


----------



## tingo (Sep 13, 2019)

Use the who(1) command, specifically `who -b`.


----------



## yuripv (Sep 13, 2019)

Try `sysctl kern.boottime`.


----------



## Sopalajo (Sep 13, 2019)

yuripv said:


> Try `sysctl kern.boottime`.



Working. Yields result in EPOCH .
Works too on pfSense.
Thanks you.


----------



## Sopalajo (Sep 13, 2019)

tingo said:


> Use the who(1) command, specifically `who -b`.



Not working on pfSense: yields no output.


----------



## George (Sep 13, 2019)

The man file of `who` says that option "-b" gives the time of the last re-boot. Whereas `who -bTu` or `who -a` shows the time of the system boot, not restricted to reboots.


----------



## tingo (Sep 14, 2019)

Sopalajo said:


> Not working on pfSense: yields no output.


ah, but you see - you asked about FreeBSD, on a FreeBSD forum. Not pfSense - which isn't FreeBSD.


----------



## tingo (Sep 14, 2019)

Elazar said:


> The man file of `who` says that option "-b" gives the time of the last re-boot. Whereas `who -bTu` or `who -a` shows the time of the system boot, not restricted to reboots.


Good - you should always (try to) verify information yourself (as you have done here) instead of assuming that the information others give you is correct, complete and relevant.


----------



## SirDice (Sep 16, 2019)

Sopalajo said:


> Not working on pfSense: yields no output.


In case you didn't read the rules: PC-BSD, FreeNAS, XigmaNAS, and all other FreeBSD Derivatives


----------



## Sopalajo (Sep 16, 2019)

Yes, my question was about FreeBSD, not pfSense; the 
	
	



```
who -b
```
 method worked fine on FreeBSD, but I have been able to try it too on pfSense, and I was assuming some pfSense user arriving here (some times, like when scripting, you do prefer the standard method, instead of the specific one) could use that info.

I will avoid speaking too about pfSense the next time, no problem.


----------



## LakeCowabunga (Sep 30, 2019)

Elazar said:


> Whereas `who -bTu` or `who -a` shows the time of the system boot, not restricted to reboots.



Hey, thanks!  Just tested, and also works on Darwin unix.


----------

