It’s always nice when a filmmaker toys with the conventions of a genre, even when the effort doesn’t quite succeed. That’s the case with “(500) Days of Summer,” a quirky romantic comedy that not only messes with the chronology of a typical boy-meets-girl story—taking us back and forth over the course of the relationship by shuffling the day numbers in credit cards—but ends up somewhat differently than you might anticipate (as well as boasting a cutesy title). It’s an experiment you have to admire for the risks it takes even while being disappointed that it doesn’t quite come off

The boy’s played by Joseph Gordon-Levitt, and director Marc Webb is lucky to have him. He’s easily the best thing in the movie, making Tom, a writer of aphorisms at a New York greeting card company, the sort of hopeless dreamer you can sympathize with. Tom believes in true love and is convinced that Summer (Zooey Deschanel), his boss Vance’s (Clark Gregg) new assistant, is the girl for him from the very first instant he sees her. His fumbling reserve and her no-nonsense brusqueness initially make a connection between them seem unlikely; even the accidental discovery that they share tastes in music (they both love The Smiths) doesn’t have an immediate effect.

Eventually, though, Summer takes the initiative, and before long the two are a couple. The problem, as things progress, is that Tom sees the relationship as the one true love he’s always been searching for and expects it to last forever, while the free-spirited Summer dismisses the very idea of people being meant for one another and looks upon their time together as just another fling they shouldn’t take so seriously. Her attitude shifts as he becomes more possessive, and they break up, sending him into a tailspin he barely comes out of. But when they meet again at a friend’s wedding, Tom’s sure that the life with Summer he still believes to be his destiny will at last be realized. Since we’ve already been told upfront, though, that “this isn’t a love story,” the prospect is at best a toss-up.

There are plenty of good things here, especially Gordon-Levitt’s uncharacteristic turn from heady drama (he hasn’t had this light-hearted a part since “10 Things I Hate About You,” though “3d Rock from the Sun” certainly showed his comic mettle). He balances both sides of Tom’s experiences nicely, doing a perfect hangdog routine during the character’s down-in-the-dumps periods while capturing his naïve bliss during the good times. He even manages to hoof it up during an over-the-top dance routine in a park, complete with an animated bluebird of happiness. (He’s less successful in a misguided parody of foreign-movie cliches: does anybody take “The Seventh Seal” as a touchstone anymore?) Deschanel doesn’t come off nearly as well, largely because Summer is rather a self-absorbed, hard character, and she plays it that way. (You can argue that’s how Summer appears to Tom rather than the way she really is, but it doesn’t matter much.)

One way in which the picture tweaks convention to unfortunate effect is in the treatment of Tom’s buddies McKenzie (Geoffrey Arend) and Paul (Michael Gray Gubler, of “Criminal Minds”). The latter’s a homebody and the former a vulgar, hard-drinking office mate, but neither—especially the boorish Arendt—is likable or amusing. We used to get people like Gig Young and Tony Randall in such parts, often saving pictures whose leads wouldn’t have survived without them. Here the movie droops whenever these would-be scene stealers show up—very much a change for the worse. On the other hand, the script goes for the utterly predictable in the figure of Tom’s kid sister Rachel (Chloe Grace Moretz), one of those unbearably precocious sitcom figures who supposedly gives her big brother sage advice about life and love.

“Summer” is a sharp-looking picture, with the production design (Laura Fox), art direction (Charles Varga, Jr.) and costumes (Hope Hanafin) cleverly giving the “happy” sequences a brighter, more colorful appearance and Eric Steelberg’s cinematography capturing the changes expertly.

The mixture of good and bad in “(500) Days of Summer” makes its constant temporal shifts a mixed blessing. On the one hand, it’s a clever change from the usual straight-through presentation of the all-too-familiar boy-meets-girl story. On the other, it gets frustrating after a while, because you’re constantly worried the picture’s going to take you back to the stuff you’d rather not revisit. And the filmmakers’ courage eventually fails them; they can’t resist tacking on an ending that, after all their efforts to be different from run-of-the-mill romantic comedy, is as conventional as they come. This is a movie that wants to seem bittersweet, but at the close it leaves the sourness behind and just opts for the saccharine. And so in this case a happy ending leaves you a little sad, nor so much for the characters as for those who made them up.