Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda