Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
How to convert seconds to minutes in MVC?

I get the input as a second from the user and I want to show it as minutes and second in the Grid. I know I have to use a method but I don't know how.

**SeizureViewModel**
   [Display(Name ="Seizure Time")]
        public int SeizureTime{ get; set; }

**AddSeizure View**
 @Html.BSMaterialTextBoxFor(model => model.SeizureTime, "", colCSS: "col-6")

**Show Seizure View**
@model PagedList<SeizureViewModell>
<div class="row">
    <div class="col-xs-12">
        @(Html.Grid(Model)
        .Name("epileptic seizures")
        .PKColumn(p => p.ID)
        .Columns(c =>
        {
            c.Add(a => a.SeizureTime);
           
        }).HasHeader(true)
        .HasFooter(true)
        .ToolbarButtons(b => { b.Add(GridButtonType.custom).CssClass("btn addseizure").Icon("fa-plus").Title("Add Epilectic Seizure"); })
        )
    </div>
</div>

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In ViewModel , I added an another property to show the time the way I want to.

public string SeizureTimeStr
        {
            get
            {
                return (SeizureTime/ 60).ToString() +" Minutes"+ " " + (SeizureTime% 60).ToString()+" Seconds";

            }
        }

This is where I show the seizure time so I changed it as SeizureTimeStr in ShowSeizureView.

<div class="col-xs-12">
        @(Html.Grid(Model)
        .Name("epileptic seizures")
        .PKColumn(p => p.ID)
        .Columns(c =>
        {
            c.Add(a => a.SeizureTimeStr);
           
        }).HasHeader(true)
        .HasFooter(true)
        .ToolbarButtons(b => { b.Add(GridButtonType.custom).CssClass("btn addseizure").Icon("fa-plus").Title("Add Epilectic Seizure"); })
        )
    </div>
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!