C#-Quellcode
- var cmstime = DateTime.Now - JavaTimeStampToDateTime(data.services.cms.time);
- if(cmstime.Days > 3)
- {
- cmst.Text = "(>3d)";
- if (cmstime.Days <= 3)
- {
- cmst.Text = "(" + cmstime.Days.ToString() + "d)";
- if (cmstime.Days < 1)
- {
- cmst.Text = "(" + cmstime.Hours.ToString() + "h)";
- if (cmstime.Hours < 1)
- {
- cmst.Text = "(" + cmstime.Minutes.ToString() + "m)";
- if (cmstime.Minutes < 1)
- {
- cmst.Text = "(" + cmstime.Seconds.ToString() + "s)";
- }
- }
- }
- }
So soll es aussehen:
Laut steamstat.us steht bei CMS 15h. Allerdings geht das hier irgendwie nicht.
Wie ich das bsp. bei den 3h angewendet habe (siehe bild):
C#-Quellcode
- var repotime = DateTime.Now - JavaTimeStampToDateTime(data.services.repo.time);
- if(repotime.Days > 3)
- {
- }
- repot.Text = "(>3d)";
- if (repotime.Days < 3)
- {
- repot.Text = "(" + repotime.Days.ToString() + "d)";
- if (repotime.Days <= 1)
- {
- repot.Text = "(" + repotime.Hours.ToString() + "h)";
- if (repotime.Hours < 1)
- {
- repot.Text = "(" + repotime.Minutes.ToString() + "m)";
- if (repotime.Minutes < 1)
- {
- repot.Text = "(" + repotime.Seconds.ToString() + "s)";
- }
- }
- }
- }
Wie behebe ich das Problem c:?