Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Spanish
  4. Comparar Fechas
Forum Updated to NodeBB v4.3 + New Features

Comparar Fechas

Scheduled Pinned Locked Moved Solved Spanish
5 Posts 4 Posters 1.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ColomanC Offline
    ColomanC Offline
    Coloman
    wrote on last edited by
    #1

    Hola! He intentado compara fechas a partir de un QDateEdit sin exito, el codigo es el siguiente

    QString fecha_principio,fecha_fin;

    fecha_principio=ui->d_vdesde->text().trimmed();
    fecha_fin=ui->d_vhasta->text().trimmed();
    
    QDate Date_inicio = QDate::fromString(fecha_principio,"dd/MM/yyyy");
    QDate Date_fin = QDate::fromString(fecha_fin,"dd/MM/yyyy");
    
    
    
    if((Date_inicio==(Date_fin))||(Date_inicio.operator>(Date_fin)))
    

    { Mensaje de error si se cumple esta condicion}
    else
    {lo que necesito que haga}

    Nunca logro salir del mensaje de error independienteme lo que coloque en las fechas
    En la primera comparacion coloque == pero tambien he probado .operator==

    1 Reply Last reply
    0
    • JohanSoloJ Offline
      JohanSoloJ Offline
      JohanSolo
      wrote on last edited by
      #2

      This forum is English only, please post you question in the Spanish section.

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      aha_1980A 1 Reply Last reply
      1
      • JohanSoloJ JohanSolo

        This forum is English only, please post you question in the Spanish section.

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @JohanSolo I've moved the topic.

        Qt has to stay free or it will die.

        Pablo J. RoginaP 1 Reply Last reply
        1
        • aha_1980A aha_1980

          @JohanSolo I've moved the topic.

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @aha_1980 you may want to close this post as OP double posted in Spanish section as well (see 2 posts with same title/content)

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Closed as duplicate of https://forum.qt.io/topic/99320/comparar-fechas

            Qt has to stay free or it will die.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved