# How to detect if running in browser or server

**URL:** <https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579>\
**Category:** Radzen.Blazor Components\
**Created:** [October 31, 2023, 3:00pm UTC](https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579 "2023-10-31T15:00:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![figuerres](https://forum.radzen.com/letter_avatar_proxy/v4/letter/f/a183cd/32.png) [@figuerres](https://forum.radzen.com/u/figuerres)\
**Post date:** [October 31, 2023, 3:00pm UTC](https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579/1 "2023-10-31T15:00:05Z")

</div>

does radzen set any kind of global flag or have any method to detect that the current code is running from a webassembly or the server ?

how should this be done ?  
i see some code for this but i want to create a new component to run as part of a radzen app so i want to know if there is a built in function or flag so that i am not re inventing the wheel so to speak.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [October 31, 2023, 3:31pm UTC](https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579/2 "2023-10-31T15:31:08Z")

</div>

There is no such code in the Radzen.Blazor components as far as I know.

---

<div class="post-metadata">

**Author:** ![figuerres](https://forum.radzen.com/letter_avatar_proxy/v4/letter/f/a183cd/32.png) [@figuerres](https://forum.radzen.com/u/figuerres)\
**Post date:** [October 31, 2023, 3:50pm UTC](https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579/3 "2023-10-31T15:50:20Z")

</div>

interesting.

so there are no places where any of the radzen classes change what they do based on runtime environment ?

i am looking into handling the client timezone info. an azure server runs with datetime on utc time.  
on a client the timezone may be any timezone....  
if i am executing code in the browser the offset might be -5 hours on the server +0 hours.

also some functions may only be on a server os.  
or getting data on the client may need more time to download it from the server....

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [October 31, 2023, 4:25pm UTC](https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579/4 "2023-10-31T16:25:33Z")

</div>

> [@figuerres](#):
>
> so there are no places where any of the radzen classes change what they do based on runtime environment ?

No such thing.

I suggest searching online how to deal with timezones in Blazor. It is a general Blazor topic and probably better resources exist than the Radzen forum.

---

<div class="post-metadata">

**Author:** ![figuerres](https://forum.radzen.com/letter_avatar_proxy/v4/letter/f/a183cd/32.png) [@figuerres](https://forum.radzen.com/u/figuerres)\
**Post date:** [October 31, 2023, 5:52pm UTC](https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579/5 "2023-10-31T17:52:57Z")

</div>

yes i am doing other research on timezones and other parts.

i just wanted to make sure that if there was any info already in radzen about running web assembly / server that i would use it in place of duplicating it.

i have found some code for it, i will use that code and when i contribute this you might want to make it aviliable to others who might have a need to know which way the component is running.

thanks.

---

<div class="post-metadata">

**Author:** ![daveg1466](https://forum.radzen.com/user_avatar/forum.radzen.com/daveg1466/32/18767_2.png) [@daveg1466](https://forum.radzen.com/u/daveg1466)\
**Post date:** [April 6, 2024, 9:31am UTC](https://forum.radzen.com/t/how-to-detect-if-running-in-browser-or-server/15579/6 "2024-04-06T09:31:45Z")

</div>

I would look at TimeProvider....It has helped me immensely with time zone issues...
